diff options
| author | 2023-11-03 21:25:40 +0800 | |
|---|---|---|
| committer | 2023-11-03 21:25:40 +0800 | |
| commit | 9029588590bea8b10451575c5142dcde77ecd1b5 (patch) | |
| tree | 04cf8aee56c23fd225ff19d340f7cee621d874ef /packages/turbo-codemod/src/utils/checkGitStatus.ts | |
| parent | 94071d7ce16c56641d67d488e2bac6be84ffe731 (diff) | |
| download | HydroRoll-9029588590bea8b10451575c5142dcde77ecd1b5.tar.gz HydroRoll-9029588590bea8b10451575c5142dcde77ecd1b5.zip | |
chore: delete useless files
Diffstat (limited to 'packages/turbo-codemod/src/utils/checkGitStatus.ts')
| -rw-r--r-- | packages/turbo-codemod/src/utils/checkGitStatus.ts | 40 |
1 files changed, 0 insertions, 40 deletions
diff --git a/packages/turbo-codemod/src/utils/checkGitStatus.ts b/packages/turbo-codemod/src/utils/checkGitStatus.ts deleted file mode 100644 index 68d39ae..0000000 --- a/packages/turbo-codemod/src/utils/checkGitStatus.ts +++ /dev/null @@ -1,40 +0,0 @@ -import chalk from "chalk"; -import isGitClean from "is-git-clean"; - -export default function checkGitStatus({ - directory, - force, -}: { - directory?: string; - force: boolean; -}) { - let clean = false; - let errorMessage = "Unable to determine if git directory is clean"; - try { - clean = isGitClean.sync(directory || process.cwd()); - errorMessage = "Git directory is not clean"; - } catch (err: any) { - if (err && err.stderr && err.stderr.indexOf("not a git repository") >= 0) { - clean = true; - } - } - - if (!clean) { - if (force) { - console.log( - `${chalk.yellow("WARNING")}: ${errorMessage}. Forcibly continuing...` - ); - } else { - console.log("Thank you for using @turbo/codemod!"); - console.log( - chalk.yellow( - "\nBut before we continue, please stash or commit your git changes." - ) - ); - console.log( - "\nYou may use the --force flag to override this safety check." - ); - process.exit(1); - } - } -} |
