diff --git a/package.json b/package.json index 3f308c6..064c9de 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,7 @@ "format": "prettier *.js eustia/*.js src/**/*.{js,scss,css} script/*.js test/*.{js,html} --write", "lint": "eslint src/**/*.js", "lint:fix": "npm run lint -- --fix", - "setup": "node script/cpTestLib", + "setup": "shx mkdir -p test/lib && shx cp node_modules/jasmine-core/lib/jasmine-core/{jasmine.css,jasmine.js,jasmine-html.js,boot.js} test/lib && shx cp node_modules/jasmine-jquery/lib/jasmine-jquery.js test/lib && shx cp node_modules/jquery/dist/jquery.js test/lib", "genIcon": "node script/genIcon", "genUtilDoc": "eustia doc src/lib/util.js -f md -o doc/UTIL_API.md -t \"Eruda Util Documentation\"" }, @@ -37,7 +37,6 @@ "@babel/runtime": "^7.6.3", "autoprefixer": "^9.7.1", "babel-loader": "^8.0.6", - "copy": "^0.3.2", "css-loader": "^0.28.7", "draggabilly": "^2.2.0", "eslint": "^6.6.0", diff --git a/script/cpTestLib.js b/script/cpTestLib.js deleted file mode 100644 index 00d8697..0000000 --- a/script/cpTestLib.js +++ /dev/null @@ -1,54 +0,0 @@ -const copy = require('copy') -const path = require('path') -const mkdir = require('licia/mkdir') -const parallel = require('licia/parallel') - -mkdir(path.resolve(__dirname, '../test/lib'), function(err) { - if (err) return console.log(err) - - cpTestFiles() -}) - -function cpTestFiles() { - parallel( - [ - genCpCb( - '/jasmine-core/lib/jasmine-core/{jasmine.css,jasmine.js,jasmine-html.js,boot.js}', - '/lib', - { - srcBase: '/jasmine-core/lib/jasmine-core/' - } - ), - genCpCb('/jasmine-jquery/lib/jasmine-jquery.js', '/lib', { - srcBase: '/jasmine-jquery/lib/' - }), - genCpCb('/jquery/dist/jquery.js', '/lib', { - srcBase: '/jquery/dist/' - }) - ], - function(err) { - if (err) return console.log(err) - - console.log('Copy test lib successfully!') - } - ) -} - -function genCpCb(src, dest, options) { - options = options || {} - if (options.srcBase) - options.srcBase = - path.resolve(__dirname, '../node_modules/') + options.srcBase - - src = path.resolve(__dirname, '../node_modules/') + src - dest = path.resolve(__dirname, '../test/') + dest - - return function(cb) { - console.log('Copy %s to %s', src, dest) - copy(src, dest, options, function(err) { - if (err) return cb(err) - - cb() - }) - } -}