Skip to content

Commit

Permalink
Fix: Add version to the cache file name (#50)
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolo-ribaudo authored and phated committed Dec 17, 2018
1 parent cc25ce1 commit 24622a1
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,15 @@ const path = require('path');
const crypto = require('crypto');
const execFile = require('child_process').execFile;
const configPath = require('./config-path.js')(process.platform);
const version = require("./package.json").version;
const env = process.env;
const user = env.LOGNAME || env.USER || env.LNAME || env.USERNAME || '';
const exclusions = ['--help'];

const configfile = '.v8flags.'+process.versions.v8+'.'+crypto.createHash('md5').update(user).digest('hex')+'.json';
// This number must be incremented whenever the generated cache file changes.
const CACHE_VERSION = 1;

const configfile = '.v8flags-'+CACHE_VERSION+'-'+process.versions.v8+'.'+crypto.createHash('md5').update(user).digest('hex')+'.json';

const failureMessage = [
'Unable to cache a config file for v8flags to your home directory',
Expand Down

0 comments on commit 24622a1

Please # to comment.