Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Corrected the wrong message while copying failed for README.md file #2249

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
20 changes: 11 additions & 9 deletions scripts/build.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ async function buildAll() {
console.log('Building all packages...\n');
await Promise.all(
Object.entries(PACKAGES).map(([target, config]) =>
buildPackage(target, config)
)
buildPackage(target, config),
),
);
}

Expand All @@ -85,11 +85,11 @@ async function buildPackage(target, config) {
buildRollup(
`recoil (${buildType})`,
createInputOption(buildType, target, config.inputFile),
packageTypes.map((type) =>
createOutputOption(type, target, config.umdName)
)
)
)
packageTypes.map(type =>
createOutputOption(type, target, config.umdName),
),
),
),
);

console.log('Copying files...');
Expand All @@ -104,7 +104,9 @@ async function buildPackage(target, config) {
`${projectRootDir}/README${target === 'recoil' ? '' : '-' + target}.md`,
`${BUILD_TARGET}/${target}/README.md`,
fs.constants.COPYFILE_FICLONE,
createErrorHandler(`Failed to copy README-${target}.md`),
tajnur007 marked this conversation as resolved.
Show resolved Hide resolved
createErrorHandler(
`Failed to copy README${target === 'recoil' ? '' : '-' + target}.md`,
),
);
fs.copyFile(
`${projectRootDir}/CHANGELOG-${target}.md`,
Expand Down Expand Up @@ -150,7 +152,7 @@ async function buildRollup(name, inputOptions, outputOptionsList) {
const bundle = await rollup(inputOptions);

await Promise.all(
outputOptionsList.map((outputOptions) => bundle.write(outputOptions))
outputOptionsList.map(outputOptions => bundle.write(outputOptions)),
);
} catch (error) {
createErrorHandler(`Build for package ${name} failed!`)(error);
Expand Down