Skip to content

Commit

Permalink
fix: allow syncPairs.json to contain a SyncPair instead of `SyncPai…
Browse files Browse the repository at this point in the history
…r[]`
  • Loading branch information
JupiterPi committed Dec 10, 2024
1 parent e2a25e1 commit 41b28fd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/featureInterfaces/syncInterface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,8 @@ export class SyncInterface {
}
const file = JSON.parse((await fsModule.promises.readFile(path)).toString())
const exitTypeErr = () => errExit("Invalid sync pairs registry! Needs to be of type: {local: string, remote: string, syncMode: string, alias?: string, excludeDotFiles?: boolean, disableLocalTrash?: boolean, ignore?: string[]}[]")
if (!Array.isArray(file)) exitTypeErr()
for (const obj of file) {
const syncPairsObj = Array.isArray(file) ? file : [file]
for (const obj of syncPairsObj) {
if (typeof obj.local !== "string") exitTypeErr()
if (typeof obj.remote !== "string") exitTypeErr()
const syncMode: string = typeof obj.syncMode === "string" ? obj.syncMode : "twoWay"
Expand Down

0 comments on commit 41b28fd

Please sign in to comment.