Skip to content

Commit

Permalink
Make git clean up silent
Browse files Browse the repository at this point in the history
  • Loading branch information
redneckz committed Dec 13, 2022
1 parent d43cdac commit e1d5126
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
12 changes: 8 additions & 4 deletions scripts/generate.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,14 @@ const mkdir = promisify(fs.mkdir);
const writeFile = promisify(fs.writeFile);

export default async function generate(isMobile) {
await simpleGit().clean(
[CleanOptions.RECURSIVE, CleanOptions.FORCE, CleanOptions.IGNORED_ONLY],
[PAGES_DIR],
);
try {
await simpleGit().clean(
[CleanOptions.RECURSIVE, CleanOptions.FORCE, CleanOptions.IGNORED_ONLY],
[PAGES_DIR],
);
} catch (ex) {
// Do nothing
}

const contentPageRepository = new ContentPageRepository({
contentDir: CONTENT_DIR,
Expand Down
12 changes: 8 additions & 4 deletions scripts/prebuild.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,14 @@ const copy = promisify(copyfiles);

export default async function prebuild() {
await rmrf(BUILD_DIR);
await simpleGit().clean(
[CleanOptions.RECURSIVE, CleanOptions.FORCE, CleanOptions.IGNORED_ONLY],
[PUBLIC_DIR],
);
try {
await simpleGit().clean(
[CleanOptions.RECURSIVE, CleanOptions.FORCE, CleanOptions.IGNORED_ONLY],
[PUBLIC_DIR],
);
} catch (ex) {
// Do nothing
}

await copy([`${CONTENT_DIR}/manifest.json`, `${CONTENT_DIR}/wcms-resources/**/*`, PUBLIC_DIR], 1);
await copy(
Expand Down

0 comments on commit e1d5126

Please sign in to comment.