Skip to content

Commit

Permalink
fix build: ensure dir.
Browse files Browse the repository at this point in the history
  • Loading branch information
100pah committed Jan 2, 2020
1 parent 07ec129 commit 74d2ce6
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
7 changes: 7 additions & 0 deletions build.js
Original file line number Diff line number Diff line change
Expand Up @@ -291,20 +291,25 @@ async function buildLegacyDoc(config) {
let assetSrcPath = path.resolve(assetDir, assetPath);
let assetDestPathZH = path.resolve(config.releaseDestDir, 'zh/css', assetPath);
let assetDestPathEN = path.resolve(config.releaseDestDir, 'en/css', assetPath);
fse.ensureDirSync(path.dirname(assetDestPathZH));
fse.copyFileSync(assetSrcPath, assetDestPathZH);
fse.ensureDirSync(path.dirname(assetDestPathEN));
fse.copyFileSync(assetSrcPath, assetDestPathEN);
}

// Copy tpl.html
let tplSrcPath = path.resolve(projectDir, 'legacy/js/docTool/main.tpl.html');
let tplDestPathZH = path.resolve(config.releaseDestDir, 'zh/js/docTool/main.tpl.html');
let tplDestPathEN = path.resolve(config.releaseDestDir, 'en/js/docTool/main.tpl.html');
fse.ensureDirSync(path.dirname(tplDestPathZH));
fse.copyFileSync(tplSrcPath, tplDestPathZH);
fse.ensureDirSync(path.dirname(tplDestPathEN));
fse.copyFileSync(tplSrcPath, tplDestPathEN);

// Copy option3.json
let option3SrcPath = path.resolve(projectDir, 'legacy/option3.json');
let option3DestPath = path.resolve(config.releaseDestDir, 'zh/documents/option3.json');
fse.ensureDirSync(path.dirname(option3DestPath));
fse.copyFileSync(option3SrcPath, option3DestPath);

console.log('\nBuild legacy doc done.');
Expand Down Expand Up @@ -379,7 +384,9 @@ async function buildSpreadsheet(config) {
let tplSrcPath = path.resolve(projectDir, 'js/spreadsheet/spreadsheet.tpl.html');
let tplDestPathZH = path.resolve(config.releaseDestDir, 'zh/js/spreadsheet/spreadsheet.tpl.html');
let tplDestPathEN = path.resolve(config.releaseDestDir, 'en/js/spreadsheet/spreadsheet.tpl.html');
fse.ensureDirSync(path.dirname(tplDestPathZH));
fse.copyFileSync(tplSrcPath, tplDestPathZH);
fse.ensureDirSync(path.dirname(tplDestPathEN));
fse.copyFileSync(tplSrcPath, tplDestPathEN);

console.log('\nBuild spreadsheet done.');
Expand Down
14 changes: 11 additions & 3 deletions release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,21 @@ echo "Build examples done."

# Build www
echo "Build www ..."
node ${basePath}/build.js --env ${envType}
cd ${basePath}
node build.js --env ${envType}
cd ${currPath}
echo "Build www done."

cd ${currPath}

if [[ "${envType}" = "echartsjs" ]]; then
cd ${basePath}
zip -r echarts-www.zip release
echo "zip echarts-www.zip ..."
if [ -f echarts-www.zip ]; then
rm echarts-www.zip
fi
zip -r -q echarts-www.zip release
echo "zip echarts-www.zip done."
cd ${currPath}
fi

echo "echarts-www release done for ${envType}"

0 comments on commit 74d2ce6

Please sign in to comment.