Skip to content

Commit

Permalink
Fix issue if file has no extension on a wildcard add
Browse files Browse the repository at this point in the history
  • Loading branch information
mitchcapper committed Dec 7, 2024
1 parent 20de09c commit b6252f0
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions vs_debug_help/DebugProjGen.csx
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ void ArrExpandWithDefs(string root, List<string> arr, IEnumerable<string> addl,
var l2 = arr.Distinct().ToList();
arr.Clear();
arr.AddRange(l2);
//Console.WriteLine(string.Join(", ",arr));
//throw new Exception("ERR");
}
void ArrExpandWildcards(string root, List<string> arr){
for (var x = 0; x < arr.Count; x++){
Expand Down Expand Up @@ -133,7 +135,7 @@ Dictionary<string,string> BuildTemplateDict(ConfigRead config, Opts opts){
ArrPathFixForFiles(incl_paths, compile);
ArrPathFixForFiles(incl_paths, include);
if (! opts.GetValBool("no_autoheader")){
var posHeaders = compile.Select(file => new FileInfo(file)).Select(fInfo => Path.Combine( fInfo.DirectoryName,fInfo.Name.Substring(0,fInfo.Name.Length-fInfo.Extension.Length+1) + "h").Replace("\\","/")).ToList();
var posHeaders = compile.Select(file => new FileInfo(file)).Select(fInfo => Path.Combine( fInfo.DirectoryName,fInfo.Name.Substring(0,fInfo.Name.Length-(fInfo.Extension.Length > 0 ? fInfo.Extension.Length+1 : 0)) + "h").Replace("\\","/")).ToList();
ArrPathFixForFiles(incl_paths,posHeaders);
var exists = posHeaders.Where(a=>File.Exists(a)).ToArray();
include.AddRange(exists);
Expand Down Expand Up @@ -240,7 +242,7 @@ class ConfigRead {
public void ReadConfig() {
var PROJ_file = "proj_config.ini";
if (!File.Exists(PROJ_file))
throw new Exception($"Unable to find {PROJ_file} run /script/f_SCRIPTNAME_build.sh export_config to generate");
throw new Exception($"Unable to find {PROJ_file} in current directory run /script/f_SCRIPTNAME_build.sh export_config to generate");
var lines = File.ReadAllLines(PROJ_file);
foreach (var line in lines) {
if (!line.Contains("="))
Expand Down

0 comments on commit b6252f0

Please sign in to comment.