Skip to content

Commit f3b32d5

Browse files
committed
fix folder flag
1 parent 35ae910 commit f3b32d5

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/extensions/functions/getSolidaritySettings.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,12 @@ export const isURI = (path) => !!path.match(/\w+:(\/?\/?)[^\s]+/)
66

77
export const loadFile = (context, filePath) => {
88
const { filesystem } = context
9-
if (filesystem.exists(filePath)) {
10-
return JSON5.parse(filesystem.read('.solidarity'))
9+
if (filesystem.exists(filePath + path.sep + '.solidarity')) {
10+
return JSON5.parse(filesystem.read(filePath + path.sep + '.solidarity'))
11+
} else if (filesystem.exists(filePath + path.sep + '.solidarity.json')) {
12+
return JSON5.parse(filesystem.read(filePath + path.sep + '.solidarity.json'))
13+
} else if (filesystem.exists(filePath) === 'file') {
14+
return JSON5.parse(filesystem.read(filePath))
1115
} else {
1216
throw 'ERROR: There is no solidarity file at the given path'
1317
}

0 commit comments

Comments
 (0)