esoftplay 0.0.151 → 0.0.152
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/cli.js +9 -1
- package/package.json +1 -1
package/bin/cli.js
CHANGED
|
@@ -287,7 +287,15 @@ function switchStatusAssets(status) {
|
|
|
287
287
|
if (fs.existsSync(from)) {
|
|
288
288
|
if (fs.existsSync(to))
|
|
289
289
|
command('rm ' + to)
|
|
290
|
-
|
|
290
|
+
const oldscript = fs.readFileSync(from, 'utf8')
|
|
291
|
+
const data = oldscript.match(new RegExp(/^\/\/\s{0,}export\s{1}default/gm))
|
|
292
|
+
let newData = data;
|
|
293
|
+
if (data && data.length > 0) {
|
|
294
|
+
newData = oldscript.replace((new RegExp(/^\/\//gm)), "")
|
|
295
|
+
fs.writeFileSync(to, newData)
|
|
296
|
+
} else {
|
|
297
|
+
command('cp ' + from + ' ' + to)
|
|
298
|
+
}
|
|
291
299
|
}
|
|
292
300
|
}
|
|
293
301
|
fs.readdirSync(DIR).forEach((file) => {
|