Change `name` within `package.json` so that temporary files will not be shared across different app instances

This commit is contained in:
Jia Hao 2016-01-19 21:06:42 +08:00
parent cfd212bd94
commit 0897432062
1 changed files with 7 additions and 0 deletions

View File

@ -81,6 +81,13 @@ function copyPlaceholderApp(srcAppDir, tempDir, name, targetURL, badge, width, h
};
fs.writeFileSync(path.join(tempDir, '/nativefier.json'), JSON.stringify(appArgs));
// change name of packageJson so that temporary files will not be shared across different app instances
const packageJsonPath = path.join(tempDir, '/package.json');
const packageJson = JSON.parse(fs.readFileSync(packageJsonPath));
packageJson.name = appArgs.name + '-nativefier';
fs.writeFileSync(packageJsonPath, JSON.stringify(packageJson));
callback(null, tempDir);
});
};