diff --git a/CHANGELOG.md b/CHANGELOG.md index d44bc98..aa9d9ad 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## 1.8.4-beta.0 + +- fix: default swiftlint.path value is invalid on Windows #67 + ## 1.8.1 - fix: improved error message when SwiftLint is not installed #56 #57 diff --git a/package.json b/package.json index 500950e..33a2144 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "type": "git", "url": "https://github.com/vknabel/vscode-swiftlint" }, - "version": "1.8.3", + "version": "1.8.4-beta.0", "license": "MIT", "author": { "name": "Valentin Knabel", diff --git a/src/Current.ts b/src/Current.ts index cc215af..9b5c0df 100644 --- a/src/Current.ts +++ b/src/Current.ts @@ -161,10 +161,13 @@ export function prodEnvironment(): Current { } const fallbackGlobalSwiftFormatPath = (): string[] => { - const defaultPath = ["/usr/bin/env", "swiftlint"]; + let defaultPath = ["/usr/bin/env", "swiftlint"]; + if (os.platform() === "win32") { + defaultPath = ["swiftlint"]; + } const path = vscode.workspace .getConfiguration() - .get("swiftlint.path", defaultPath); + .get("swiftlint.path", null); if (typeof path === "string") { return [absolutePath(path)]; } else if (Array.isArray(path) && path.length > 0) {