cache-buster
Advanced tools
Comparing version 5.0.0 to 5.1.0
@@ -6,16 +6,16 @@ #!/usr/bin/env node | ||
commander | ||
.option('-w, --webapp-dir <webappDir>', 'Webapp directory') | ||
.option('-i, --index-file-name <indexFileName>', 'Index file name') | ||
.option('-w <webappDir>', 'location of generate webapp relative to cwd') | ||
.option('-i <indexFileName>', 'name of index file in webapp (default index.html)') | ||
.parse(process.argv); | ||
var fs = require('fs'); | ||
var fs = require('fs-extra'); | ||
var path = require('path'); | ||
var timeInSec = Math.floor(new Date() / 1000) + ''; | ||
var webappDir = path.join(process.cwd(), commander.webappDir); | ||
var index = '<html>' + | ||
fs.outputFileSync(path.join(process.cwd(), 'deploy'), | ||
'<html>' + | ||
'<head>' + | ||
'<script>' + | ||
'var redirect = window.location.protocol + "//" + window.location.host + window.location.pathname' + | ||
'/' + timeInSec + '/' + commander.indexFileName + 'window.location.search' + | ||
'var redirect = window.location.protocol + "//" + window.location.host + window.location.pathname' + | ||
'/' + timeInSec + '/' + commander.indexFileName + 'window.location.search' + | ||
'</script>' + | ||
@@ -25,7 +25,4 @@ '</head>' + | ||
'</body>' + | ||
'</html>'; | ||
'</html>'); | ||
fs.chmodSync(webappDir, 0666); | ||
fs.mkdirSync(path.join(webappDir, timeInSec)); | ||
fs.renameSync(webappDir, path.join(webappDir, timeInSec)); | ||
fs.writeFileSync(path.join(webappDir, 'index.html'), index); | ||
fs.copySync(path.join(process.cwd(), commander.webappDir), path.join(process.cwd(), 'deploy', timeInSec + '')); |
{ | ||
"name": "cache-buster", | ||
"version": "5.0.0", | ||
"version": "5.1.0", | ||
"description": "cache buster for static webapp", | ||
@@ -18,4 +18,5 @@ "main": "index.js", | ||
"dependencies": { | ||
"commander": "^2.9.0" | ||
"commander": "^2.9.0", | ||
"fs-extra": "^2.1.2" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
19512
2
20
+ Addedfs-extra@^2.1.2
+ Addedfs-extra@2.1.2(transitive)
+ Addedgraceful-fs@4.2.11(transitive)
+ Addedjsonfile@2.4.0(transitive)