Skip to content

Commit 322b294

Browse files
committed
Fix config bug on Windows
1 parent 80174ce commit 322b294

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

gtt-status.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ const Config = require('./include/file-config');
66
const Cli = require('./include/cli');
77
const Tasks = require('./include/tasks');
88

9-
109
program
1110
.option('--verbose', 'show verbose output')
1211
.parse(process.argv);

include/file-config.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
const fs = require('fs');
22
const path = require('path');
3+
const os = require("os");
34
const config = require('./config');
45
const yaml = require('read-yaml');
56
const hash = require('hash-sum');
@@ -68,10 +69,11 @@ class fileConfig extends config {
6869
localExists() {
6970
if (fs.existsSync(this.local)) return true;
7071

72+
let root = (os.platform() === "win32") ? process.cwd().split(path.sep)[0] + "\\" : "/";
7173
let workDir = this.workDir;
7274
while (workDir) {
7375
workDir = path.dirname(workDir);
74-
if (workDir === '/') workDir = '';
76+
if (workDir === root) workDir = '';
7577
if (fs.existsSync(Fs.join(workDir, this.localConfigFile))) {
7678
this.workDir = workDir;
7779
return true;

0 commit comments

Comments
 (0)