Skip to content

Commit

Permalink
feat: husky add pre-push.js
Browse files Browse the repository at this point in the history
  • Loading branch information
yuanyxh committed Sep 27, 2024
1 parent 895de71 commit 70bd09c
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions .husky/pre-push.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,13 @@ const prePush = async () => {
try {
const branch = await getBranch();

console.log(branch);
if (branch === 'origin/master') {
childProcess.execSync('pnpm run clean');

if (branch === 'master') {
let result = childProcess.execSync('pnpm run clean');
result = childProcess.execSync('pnpm run build');
result = childProcess.execSync('pnpm run clean');
const result = childProcess.execSync('pnpm run build');
console.log(result.toString());

childProcess.execSync('pnpm run clean');
}

} catch(err) {
Expand Down

0 comments on commit 70bd09c

Please sign in to comment.