2
2
mirror of https://github.com/Llewellynvdm/nativefier.git synced 2024-12-23 10:38:55 +00:00

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

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);
});
};