mirror of https://github.com/certd/certd
refactor: 0.1.12
parent
4a421d5b14
commit
45547d6f94
|
@ -19,5 +19,6 @@
|
||||||
"eslint-plugin-import": "^2.22.1",
|
"eslint-plugin-import": "^2.22.1",
|
||||||
"eslint-plugin-node": "^11.1.0",
|
"eslint-plugin-node": "^11.1.0",
|
||||||
"eslint-plugin-promise": "^4.2.1"
|
"eslint-plugin-promise": "^4.2.1"
|
||||||
}
|
},
|
||||||
|
"gitHead": "4a421d5b142d453203c68ce6d1036e168ea2455b"
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,5 +22,5 @@
|
||||||
"eslint-plugin-promise": "^4.2.1",
|
"eslint-plugin-promise": "^4.2.1",
|
||||||
"mocha": "^8.2.1"
|
"mocha": "^8.2.1"
|
||||||
},
|
},
|
||||||
"gitHead": "2942d39dfe64d60ce7dc0e0b2c0887866ca67f18"
|
"gitHead": "4a421d5b142d453203c68ce6d1036e168ea2455b"
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,5 +26,5 @@
|
||||||
"eslint-plugin-promise": "^4.2.1",
|
"eslint-plugin-promise": "^4.2.1",
|
||||||
"mocha": "^8.2.1"
|
"mocha": "^8.2.1"
|
||||||
},
|
},
|
||||||
"gitHead": "2942d39dfe64d60ce7dc0e0b2c0887866ca67f18"
|
"gitHead": "4a421d5b142d453203c68ce6d1036e168ea2455b"
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "echo \"Error: no test specified\" && exit 1"
|
"test": "echo \"Error: no test specified\" && exit 1"
|
||||||
},
|
},
|
||||||
|
"private": false,
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"author": "Greper",
|
"author": "Greper",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
@ -24,5 +25,5 @@
|
||||||
"eslint-plugin-promise": "^4.2.1",
|
"eslint-plugin-promise": "^4.2.1",
|
||||||
"mocha": "^8.2.1"
|
"mocha": "^8.2.1"
|
||||||
},
|
},
|
||||||
"gitHead": "2942d39dfe64d60ce7dc0e0b2c0887866ca67f18"
|
"gitHead": "4a421d5b142d453203c68ce6d1036e168ea2455b"
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,5 +34,5 @@
|
||||||
"author": "Greper",
|
"author": "Greper",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"sideEffects": false,
|
"sideEffects": false,
|
||||||
"gitHead": "2942d39dfe64d60ce7dc0e0b2c0887866ca67f18"
|
"gitHead": "4a421d5b142d453203c68ce6d1036e168ea2455b"
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,5 +24,5 @@
|
||||||
},
|
},
|
||||||
"author": "Greper",
|
"author": "Greper",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"gitHead": "2942d39dfe64d60ce7dc0e0b2c0887866ca67f18"
|
"gitHead": "4a421d5b142d453203c68ce6d1036e168ea2455b"
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import Router from 'koa-router'
|
import Router from 'koa-router'
|
||||||
import fs from 'fs'
|
import fs from 'fs'
|
||||||
import exportsService from '../service/exports-service.js'
|
import exportsService from '../service/exports-service.js'
|
||||||
// import executorPkg from '@certd/executor/package.json'
|
|
||||||
const router = Router()
|
const router = Router()
|
||||||
router.prefix('/exports')
|
router.prefix('/exports')
|
||||||
|
|
||||||
|
|
|
@ -37,5 +37,6 @@
|
||||||
"eslint-plugin-node": "^11.1.0",
|
"eslint-plugin-node": "^11.1.0",
|
||||||
"eslint-plugin-promise": "^4.2.1",
|
"eslint-plugin-promise": "^4.2.1",
|
||||||
"nodemon": "^1.19.1"
|
"nodemon": "^1.19.1"
|
||||||
}
|
},
|
||||||
|
"gitHead": "4a421d5b142d453203c68ce6d1036e168ea2455b"
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,7 +4,8 @@ import pathUtil from '../utils/util.path.js'
|
||||||
import cryptoRandomString from 'crypto-random-string'
|
import cryptoRandomString from 'crypto-random-string'
|
||||||
import zipUtil from '../utils/util.zip.js'
|
import zipUtil from '../utils/util.zip.js'
|
||||||
import path from 'path'
|
import path from 'path'
|
||||||
|
import executorPkg from '@certd/executor/package.json'
|
||||||
|
import templatePkg from '@/templates/certd-run/package.json'
|
||||||
export default {
|
export default {
|
||||||
async exportsToZip (options, dirName) {
|
async exportsToZip (options, dirName) {
|
||||||
const tempDir = os.tmpdir()
|
const tempDir = os.tmpdir()
|
||||||
|
@ -19,11 +20,16 @@ export default {
|
||||||
console.log('targetProjectDir', targetProjectDir)
|
console.log('targetProjectDir', targetProjectDir)
|
||||||
fs.copySync(templateDir, targetProjectDir)
|
fs.copySync(templateDir, targetProjectDir)
|
||||||
|
|
||||||
// const packageFilePath = path.join(targetProjectDir, 'package.json')
|
// options
|
||||||
const optionsFilePath = path.join(targetProjectDir, 'options.json')
|
const optionsFilePath = path.join(targetProjectDir, 'options.json')
|
||||||
|
|
||||||
fs.writeJsonSync(optionsFilePath, options)
|
fs.writeJsonSync(optionsFilePath, options)
|
||||||
|
|
||||||
|
// 依赖版本
|
||||||
|
const currentVersion = executorPkg.version
|
||||||
|
templatePkg.dependencies['@certd/executor'] = '^' + currentVersion
|
||||||
|
const pkgFilePath = path.join(targetProjectDir, 'package.json')
|
||||||
|
fs.writeJsonSync(pkgFilePath, templatePkg)
|
||||||
|
|
||||||
const zipName = dirName + '.zip'
|
const zipName = dirName + '.zip'
|
||||||
const outputFilePath = path.join(targetDir, zipName)
|
const outputFilePath = path.join(targetDir, zipName)
|
||||||
|
|
||||||
|
|
|
@ -56,5 +56,6 @@
|
||||||
"vue-cli-service lint",
|
"vue-cli-service lint",
|
||||||
"git add"
|
"git add"
|
||||||
]
|
]
|
||||||
}
|
},
|
||||||
|
"gitHead": "4a421d5b142d453203c68ce6d1036e168ea2455b"
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue