diff options
author | 2021-10-14 18:55:41 -0700 | |
---|---|---|
committer | 2021-10-14 18:55:41 -0700 | |
commit | bbc1bcbed125e4aeacac0c374f717f65adb838ea (patch) | |
tree | a3ae72a500afc507231d3f97c7d0762c76614a51 /misctools/publish-examples.js | |
parent | 3ed824fe0fc14d21a5c035d84891b8ecf28e3c44 (diff) | |
download | bun-bbc1bcbed125e4aeacac0c374f717f65adb838ea.tar.gz bun-bbc1bcbed125e4aeacac0c374f717f65adb838ea.tar.zst bun-bbc1bcbed125e4aeacac0c374f717f65adb838ea.zip |
Support local templates
Diffstat (limited to 'misctools/publish-examples.js')
-rw-r--r-- | misctools/publish-examples.js | 27 |
1 files changed, 20 insertions, 7 deletions
diff --git a/misctools/publish-examples.js b/misctools/publish-examples.js index f29be6035..b774e234f 100644 --- a/misctools/publish-examples.js +++ b/misctools/publish-examples.js @@ -56,18 +56,31 @@ for (let folder of examplesFolderEntries) { } var retryCount = 5; + // Never commit lockfiles + try { + fs.rmSync(path.join(absolute, "package-lock.json")); + } catch (exception) {} + + try { + fs.rmSync(path.join(absolute, "yarn.lock")); + } catch (exception) {} + + try { + fs.rmSync(path.join(absolute, "pnpm-lock.yaml")); + } catch (exception) {} + + try { + fs.copyFileSync( + path.join(absolute, ".gitignore"), + path.join(absolute, "gitignore") + ); + } catch (exception) {} + restart: while (retryCount-- > 0) { packageJSON.version = version; if ("private" in packageJSON) delete packageJSON.private; if ("license" in packageJSON) delete packageJSON.license; - try { - fs.copyFileSync( - path.join(absolute, ".gitignore"), - path.join(absolute, "gitignore") - ); - } catch (exception) {} - fs.writeFileSync( path.join(absolute, "package.json"), JSON.stringify(packageJSON, null, 2) |