Use local package only and replace 'latest' with version number

https://firstdoit.com/no-need-for-globals-using-npm-dependencies-in-npm-scripts-3dfb478908?gi=9f1ea80a068
Specify 'latest' doesn't necessarily install the latest version
https://stackoverflow.com/a/39650983
This commit is contained in:
curben 2018-10-26 17:49:15 +10:30
parent 8f236bd28f
commit 0e7fbcbd0b
3 changed files with 20 additions and 20 deletions

View File

@ -6,12 +6,8 @@ test:
- node_modules/ # Node modules and dependencies
script:
- npm install -g snyk hexo-cli
- npm install # install node modules
- snyk auth $SNYK_TOKEN
- snyk protect # Apply patches to node modules
- snyk test # Check node modules for vulnerability
- hexo generate # Generate static files for debugging
- npm install
- npm run build
only:
- master # this job will affect only the 'master' branch

View File

@ -1,6 +1,6 @@
[context.production]
publish = "public"
command = "snyk auth $SNYK_TOKEN && snyk protect && snyk test && hexo generate"
command = "npm run build"
[[headers]]
for = "/*"

View File

@ -5,18 +5,22 @@
"hexo": {
"version": "3.8.0"
},
"scripts": {
"build": "snyk auth $SNYK_TOKEN && snyk protect && snyk test && hexo generate"
},
"dependencies": {
"hexo": "latest",
"hexo-nofollow": "latest",
"hexo-generator-archive": "latest",
"hexo-generator-category": "latest",
"hexo-generator-index": "latest",
"hexo-generator-tag": "latest",
"hexo-renderer-ejs": "latest",
"hexo-renderer-marked": "latest",
"hexo-renderer-stylus": "latest",
"hexo-server": "latest",
"hexo-yam": "latest",
"snyk": "latest"
"hexo": "^3.8.0",
"hexo-cli": "^1.1.0",
"hexo-generator-archive": "^0.1.5",
"hexo-generator-category": "^0.1.3",
"hexo-generator-index": "^0.2.1",
"hexo-generator-tag": "^0.2.0",
"hexo-nofollow": "^1.0.2",
"hexo-renderer-ejs": "^0.3.1",
"hexo-renderer-marked": "^0.3.2",
"hexo-renderer-stylus": "^0.3.3",
"hexo-server": "^0.3.3",
"hexo-yam": "^1.0.2",
"snyk": "^1.105.0"
}
}
}