mirror of
https://github.com/steedos/steedos-platform
synced 2024-11-22 00:01:52 +00:00
add scripts : start-dev
用于开发测试,防止template project被改坏
This commit is contained in:
parent
d108fbb7b6
commit
df6fc44d9a
2
.gitignore
vendored
2
.gitignore
vendored
@ -62,3 +62,5 @@ packages/cli/dist/**
|
||||
|
||||
docker-volumes
|
||||
packages/node-red-app-template/yarn.lock
|
||||
|
||||
steedos-projects/project-dev/**
|
45
.scripts/create_dev_project.js
Normal file
45
.scripts/create_dev_project.js
Normal file
@ -0,0 +1,45 @@
|
||||
const cpy = require('cpy');
|
||||
const path = require('path');
|
||||
const fs = require('fs');
|
||||
|
||||
if (fs.existsSync(path.join(process.cwd(), 'steedos-projects', 'project-dev'))) {
|
||||
return;
|
||||
}
|
||||
|
||||
cpy([
|
||||
'**',
|
||||
'.steedos/**',
|
||||
'!.steedos/node_modules/**',
|
||||
'.vscode/**',
|
||||
'!**/node_modules/**',
|
||||
'!logs/**',
|
||||
'.env.local',
|
||||
'!steedos-config-k8s.yml',
|
||||
'!storage/**',
|
||||
'.gitignore',
|
||||
'!init_home.sh',
|
||||
'.env',
|
||||
], '../../steedos-projects/project-dev', {
|
||||
parents: true,
|
||||
flat: false,
|
||||
cwd: path.join(process.cwd(), 'steedos-projects', 'project-template'),
|
||||
rename: (name) => {
|
||||
switch (name) {
|
||||
// case '.env':
|
||||
// return 'env'
|
||||
// case '.gitignore': {
|
||||
// return 'gitignore'
|
||||
// }
|
||||
// case 'package.json': {
|
||||
// return '_package.json'
|
||||
// }
|
||||
default: {
|
||||
return name
|
||||
}
|
||||
}
|
||||
}
|
||||
}).then(() => {
|
||||
console.log(`Create a development project: steedos-projects/project-dev`);
|
||||
}).catch((result) => {
|
||||
console.log(`error`, result);
|
||||
})
|
@ -28,7 +28,9 @@
|
||||
"update-yarn": "curl --compressed -o- -L https://yarnpkg.com/install.sh | bash",
|
||||
"sync-to-taobao": "node .scripts/sync_to_taobao.js",
|
||||
"build_image": "node build_image.js",
|
||||
"build_creator": "cd creator && yarn run build"
|
||||
"build_creator": "cd creator && yarn run build",
|
||||
"create_dev_project": "node .scripts/create_dev_project.js",
|
||||
"start-dev": "yarn create_dev_project && cd steedos-projects && cd project-dev && yarn start"
|
||||
},
|
||||
"resolutions": {
|
||||
"**/lodash": "^4.17.15",
|
||||
|
Loading…
Reference in New Issue
Block a user