From f58d9dbcf4f1e314af8f7ee35e026983c597926e Mon Sep 17 00:00:00 2001 From: "pengfei.zhou" Date: Sat, 21 Mar 2020 14:55:41 +0800 Subject: [PATCH] feat:fix cli copy path --- doric-cli/scripts/init.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doric-cli/scripts/init.js b/doric-cli/scripts/init.js index 3b5895fd..d80c7c36 100644 --- a/doric-cli/scripts/init.js +++ b/doric-cli/scripts/init.js @@ -6,7 +6,7 @@ require('shelljs/global') const targetJSPath = `${__dirname}/../target/` const targetAndroidPath = `${__dirname}/../target/android` const targetiOSPath = `${__dirname}/../target/iOS` -const currentVersion = fs.readFileSync(`${__dirname}/../version`).toString() +const currentVersion = fs.readFileSync(`${targetJSPath}/version`).toString() function copyFile(srcPath, tarPath, cb) { var rs = fs.createReadStream(srcPath) rs.on('error', function (err) { @@ -94,7 +94,7 @@ function initAndroid(path, name) { copyFolder(`${targetAndroidPath}`, `${path}`, () => { ['app/src/main/java/pub/doric/example/MainActivity.java', 'app/build.gradle'].forEach(e => { fs.writeFileSync(`${path}/${e}`, - fs.readFileSync(`${targetiOSPath}/${e}`).toString() + fs.readFileSync(`${targetAndroidPath}/${e}`).toString() .replace(/__\$__/g, name) .replace(/__\$Version__/g, currentVersion)) })