yuniql icon indicating copy to clipboard operation
yuniql copied to clipboard

Add more test coverage to cover casing and format of environment-aware directory names

Open rdagumampan opened this issue 3 years ago • 0 comments

@absurdiumnoil I think yuniql is case insensitive in terms of directory names. Appreciate if you can test run and let me know if there was anything broken. I must admit I haven't spent much time lately testing the container image releases. If you can do with install the CLI via dotnet tool or choco, I would recommend this until we have more coverage on container images.

https://github.com/rdagumampan/yuniql/blob/01465775b1d19604222d4a511dd9a13e0ae40f97/yuniql-core/DirectoryService.cs#L76

           //remove all script files from environment-aware directories except the target environment
           var sqlScriptFiles = new List<string>(files);
           files.ForEach(f =>
           {
               var fileParts = Split(new DirectoryInfo(Path.GetDirectoryName(f))).Where(x => !x.Equals(RESERVED_DIRECTORY_NAME.TRANSACTION, System.StringComparison.InvariantCultureIgnoreCase)).ToList();
               fileParts.Reverse();

               var foundFile = fileParts.Skip(directoryPathParts.Count).FirstOrDefault(a => a.StartsWith(RESERVED_DIRECTORY_NAME.PREFIX) && a.ToLower() != $"{RESERVED_DIRECTORY_NAME.PREFIX}{environmentCode}");
               if (null != foundFile)
                   sqlScriptFiles.Remove(f);
           });

Originally posted by @rdagumampan in https://github.com/rdagumampan/yuniql/issues/244#issuecomment-1026330274

rdagumampan avatar Feb 01 '22 00:02 rdagumampan