Skip to content

Commit 67267e5

Browse files
Correct path manipulation on Windows and UNIX (#504)
This fixes #489
1 parent d76e538 commit 67267e5

File tree

3 files changed

+14
-3
lines changed

3 files changed

+14
-3
lines changed

save-cli/src/commonNonJsMain/kotlin/com/saveourtool/save/cli/config/SavePropertiesExt.kt

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ fun SaveProperties.Companion.of(args: Array<String>): SaveProperties {
2424
val configFromCli = try {
2525
parseArgs(fs, args)
2626
} catch (e: IOException) {
27-
return logErrorAndExit(
27+
logErrorAndExit(
2828
ExitCodes.INVALID_CONFIGURATION,
2929
"Save expects to get the root directory for test files as the first CLI argument: save [cli-options] <test-root> [...]. " +
3030
"Provided value to cli as a root for test directory and is not able to find it. " +
@@ -46,7 +46,7 @@ private fun SaveProperties.validate(): SaveProperties {
4646
try {
4747
fs.metadata(fullConfigPath)
4848
} catch (e: FileNotFoundException) {
49-
return logErrorAndExit(
49+
logErrorAndExit(
5050
ExitCodes.INVALID_CONFIGURATION, "Not able to find configuration file '$fullConfigPath'." +
5151
" Please provide a valid path to the test config via command-line or using the file with properties. " +
5252
" Error: ${e.message}"

save-plugins/fix-plugin/src/commonMain/kotlin/com/saveourtool/save/plugins/fix/FixPlugin.kt

+2-1
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,8 @@ class FixPlugin(
210210
// instead, there was created sarif file with list of fixes, which we will apply ourselves
211211
val fixedFiles = SarifFixAdapter(
212212
sarifFile = sarifFile,
213-
targetFiles = testsPaths
213+
targetFiles = testsPaths,
214+
testRoot = testConfig.getRootConfig().directory,
214215
).process()
215216

216217
// sarif file was created by us, remove tmp data

settings.gradle.kts

+10
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,16 @@ dependencyResolutionManagement {
1515
maven {
1616
url = uri("https://s01.oss.sonatype.org/content/repositories/snapshots/")
1717
}
18+
maven {
19+
name = "saveourtool/okio-extras"
20+
url = uri("https://maven.pkg.github.com/saveourtool/okio-extras")
21+
credentials {
22+
username = providers.gradleProperty("gprUser").orNull
23+
?: System.getenv("GITHUB_ACTOR")
24+
password = providers.gradleProperty("gprKey").orNull
25+
?: System.getenv("GITHUB_TOKEN")
26+
}
27+
}
1828
}
1929
}
2030
enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS")

0 commit comments

Comments
 (0)