Skip to content

Commit

Permalink
Remove non criticalerrors during build on Linux
Browse files Browse the repository at this point in the history
Fixes #824
  • Loading branch information
bongiozzo authored and 3y3 committed Oct 24, 2024
1 parent 1b7422a commit fe0b789
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
9 changes: 4 additions & 5 deletions src/cmd/build/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -241,11 +241,10 @@ async function handler(args: Arguments<any>) {
await SearchService.release();

// Copy all generated files to user' output folder
shell.cp(
'-r',
[join(tmpOutputFolder, '*'), join(tmpOutputFolder, '.*')],
userOutputFolder,
);
shell.cp('-r', join(tmpOutputFolder, '*'), userOutputFolder);
if (glob.sync('.*', {cwd: tmpOutputFolder}).length) {
shell.cp('-r', join(tmpOutputFolder, '.*'), userOutputFolder);
}

if (publish) {
const DEFAULT_PREFIX = process.env.YFM_STORAGE_PREFIX ?? '';
Expand Down
8 changes: 6 additions & 2 deletions src/steps/processExcludedFiles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ export function processExcludedFiles() {
const tocSpecifiedFiles = new Set(navigationPaths);
const excludedFiles = allContentFiles.filter((filePath) => !tocSpecifiedFiles.has(filePath));

shell.rm('-f', excludedFiles);
if (excludedFiles.length) {
shell.rm('-f', excludedFiles)
}

const includedTocPaths = TocService.getIncludedTocPaths().map((filePath) => {
const relativeTocPath = relative(inputFolderPath, filePath);
Expand All @@ -34,5 +36,7 @@ export function processExcludedFiles() {
return convertBackSlashToSlash(destTocPath);
});

shell.rm('-rf', includedTocPaths);
if (includedTocPaths.length) {
shell.rm('-rf', includedTocPaths)
}
}

0 comments on commit fe0b789

Please sign in to comment.