diff --git a/packages/tools/checkIgnoredFiles.ts b/packages/tools/checkIgnoredFiles.ts index b68e70a886..b2103cee08 100644 --- a/packages/tools/checkIgnoredFiles.ts +++ b/packages/tools/checkIgnoredFiles.ts @@ -1,9 +1,11 @@ import { execCommand, getRootDir } from '@joplin/utils'; +import { toSystemSlashes } from '@joplin/utils/path'; import { readFile, writeFile } from 'fs-extra'; import { chdir } from 'process'; const main = async () => { - chdir(await getRootDir()); + const rootDir = await getRootDir(); + chdir(rootDir); const previousContent = { '.gitignore': await readFile('.gitignore', 'utf8'), @@ -20,7 +22,7 @@ const main = async () => { if (newContent['.gitignore'] !== previousContent['.gitignore'] || newContent['.eslintignore'] !== previousContent['.eslintignore']) { await writeFile('.gitignore', previousContent['.gitignore'], 'utf8'); await writeFile('.eslintignore', previousContent['.eslintignore'], 'utf8'); - throw new Error('.gitignore or .eslintignore would be modified - run `yarn updateIgnored`'); + throw new Error(`.gitignore or .eslintignore would be modified - run \`cd "${toSystemSlashes(rootDir)}" && yarn updateIgnored\``); } };