Skip to content

Commit fe9973d

Browse files
authored
fix: stop using npx for git commands (#459)
1 parent 94094e9 commit fe9973d

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/repository.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -103,31 +103,31 @@ abstract class Repository extends AsyncOptionalCreatable<RepositoryOptions> {
103103

104104
public getBranchName(): string {
105105
const branch =
106-
this.env.getString('CIRCLE_BRANCH', null) || exec('npx git branch --show-current', { silent: true }).stdout;
106+
this.env.getString('CIRCLE_BRANCH', null) || exec('git branch --show-current', { silent: true }).stdout;
107107
return ensureString(branch);
108108
}
109109

110110
public pushChangesToGit(): void {
111111
const branch = this.getBranchName();
112-
const cmd = `npx git push --set-upstream --no-verify --follow-tags origin ${branch}`;
112+
const cmd = `git push --set-upstream --no-verify --follow-tags origin ${branch}`;
113113
this.execCommand(cmd, false);
114114
}
115115

116116
public stageChanges(): void {
117-
this.execCommand('npx git add .', false);
117+
this.execCommand('git add .', false);
118118
}
119119

120120
public revertUnstagedChanges(): void {
121-
const changedFiles = exec('npx git diff --name-only', { silent: true })
121+
const changedFiles = exec('git diff --name-only', { silent: true })
122122
.stdout.split(os.EOL)
123123
.filter((f) => !!f);
124124
changedFiles.forEach((file) => {
125-
exec(`npx git checkout -- ${file}`, { silent: false });
125+
exec(`git checkout -- ${file}`, { silent: false });
126126
});
127127
}
128128

129129
public revertAllChanges(): void {
130-
exec('npx git reset --hard HEAD', { silent: true });
130+
exec('git reset --hard HEAD', { silent: true });
131131
}
132132

133133
public printStage(msg: string): void {

0 commit comments

Comments
 (0)