:|
This commit is contained in:
11
lib/main.js
11
lib/main.js
@@ -36,8 +36,15 @@ async function compileProject(name) {
|
||||
error = e.message;
|
||||
}
|
||||
//add UserScript header
|
||||
let content = (0, fs_1.readFileSync)(outPath).toString();
|
||||
(0, fs_1.writeFileSync)(outPath, metaString + content);
|
||||
if ((0, fs_1.lstatSync)(outPath).isFile()) {
|
||||
if (!error) {
|
||||
let content = (0, fs_1.readFileSync)(outPath).toString();
|
||||
(0, fs_1.writeFileSync)(outPath, metaString + content);
|
||||
}
|
||||
else {
|
||||
(0, fs_1.unlinkSync)(outPath);
|
||||
}
|
||||
}
|
||||
return [metaJson, error];
|
||||
}
|
||||
if (!(0, fs_1.lstatSync)('package.json').isFile()) {
|
||||
|
||||
Reference in New Issue
Block a user