mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2024-11-12 22:50:54 +03:00
Use fingerprint to invalidate cache
This commit is contained in:
parent
1e00a9ad27
commit
ea969d71ec
@ -18,10 +18,14 @@ dependencies:
|
||||
- nvm install 4.4.7
|
||||
- nvm use 4.4.7
|
||||
- npm install -g npm
|
||||
- script/fingerprint-clean
|
||||
|
||||
override:
|
||||
- script/bootstrap
|
||||
|
||||
post:
|
||||
- script/fingerprint-write
|
||||
|
||||
cache_directories:
|
||||
- apm/node_modules
|
||||
- build/node_modules
|
||||
|
23
script/fingerprint-clean
Executable file
23
script/fingerprint-clean
Executable file
@ -0,0 +1,23 @@
|
||||
#!/usr/bin/env node
|
||||
var fingerprint = require('./utils/fingerprint')
|
||||
|
||||
if (fingerprint.fingerprintMatches()) {
|
||||
console.log('node_modules matches current fingerprint ' + fingerprint.fingerprint() + ' - not removing')
|
||||
return
|
||||
}
|
||||
|
||||
var fsPlus
|
||||
try {
|
||||
fsPlus = require('fs-plus')
|
||||
} catch (error) {
|
||||
console.log(error.message)
|
||||
return
|
||||
}
|
||||
|
||||
try {
|
||||
fsPlus.removeSync(path.resolve(__dirname, '..', 'node_modules'))
|
||||
fsPlus.removeSync(path.resolve(__dirname, '..', 'apm', 'node_modules'))
|
||||
} catch (error) {
|
||||
console.error(error.message)
|
||||
process.exit(1)
|
||||
}
|
2
script/fingerprint-write
Executable file
2
script/fingerprint-write
Executable file
@ -0,0 +1,2 @@
|
||||
#!/usr/bin/env node
|
||||
require('./utils/fingerprint').writeFingerprint()
|
Loading…
Reference in New Issue
Block a user