Commit f5ede3bd authored by liujiangnan's avatar liujiangnan

feat: 统一文件夹

parent 0af5564c
...@@ -60,4 +60,4 @@ var server = http.createServer(function (request, response) { ...@@ -60,4 +60,4 @@ var server = http.createServer(function (request, response) {
server.listen(PORT); server.listen(PORT);
console.log("Server runing at port: " + PORT + "."); console.log("Server runing at port: " + PORT + ".");
console.log("visit form : http://localhost:"+PORT+"/form/index.html"); console.log("visit form : http://localhost:"+PORT+"/form/index.html");
console.log("visit index : http://localhost:"+PORT+"/index/index.html"); console.log("visit play : http://localhost:"+PORT+"/play/index.html");
\ No newline at end of file \ No newline at end of file
...@@ -71,9 +71,9 @@ const runSpawn = async function (){ ...@@ -71,9 +71,9 @@ const runSpawn = async function (){
fs.mkdirSync(path.resolve(__dirname,"../dist/form")); fs.mkdirSync(path.resolve(__dirname,"../dist/form"));
} }
try { try {
await fsp.access(path.resolve(__dirname,"../dist/index"), fs.constants.F_OK); await fsp.access(path.resolve(__dirname,"../dist/play"), fs.constants.F_OK);
} catch (error) { } catch (error) {
fs.mkdirSync(path.resolve(__dirname,"../dist/index")); fs.mkdirSync(path.resolve(__dirname,"../dist/play"));
} }
try { try {
await fsp.access(path.resolve(__dirname,"../dist/lib"), fs.constants.F_OK); await fsp.access(path.resolve(__dirname,"../dist/lib"), fs.constants.F_OK);
...@@ -81,12 +81,12 @@ const runSpawn = async function (){ ...@@ -81,12 +81,12 @@ const runSpawn = async function (){
fs.mkdirSync(path.resolve(__dirname,"../dist/lib")); fs.mkdirSync(path.resolve(__dirname,"../dist/lib"));
} }
await copy(path.resolve(__dirname,"../form"), path.resolve(__dirname,"../dist/form")); await copy(path.resolve(__dirname,"../form"), path.resolve(__dirname,"../dist/form"));
await copy(path.resolve(__dirname,"../index"), path.resolve(__dirname,"../dist/index")); await copy(path.resolve(__dirname,"../play"), path.resolve(__dirname,"../dist/play"));
await copy(path.resolve(__dirname,"../lib"), path.resolve(__dirname,"../dist/lib")); await copy(path.resolve(__dirname,"../lib"), path.resolve(__dirname,"../dist/lib"));
let str = fs.readFileSync(path.resolve(__dirname,"../dist/index/index.html"),{encoding: 'utf8'}); let str = fs.readFileSync(path.resolve(__dirname,"../dist/play/index.html"),{encoding: 'utf8'});
str = str.replace('<base href="">','<base href="template-base-href">'); str = str.replace('<base href="">','<base href="template-base-href">');
fs.writeFileSync(path.resolve(__dirname,"../dist/index/index.html"),str); fs.writeFileSync(path.resolve(__dirname,"../dist/play/index.html"),str);
await new Promise(function(resolve,reject){ await new Promise(function(resolve,reject){
let pkg = require("../package.json"); let pkg = require("../package.json");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment