mirror of
https://github.com/ZTatman/myst.git
synced 2026-11-21 04:17:59 +00:00
fix(cli): unlink .env.temp before writing to file in case it was already
created
This commit is contained in:
parent
cd216cd660
commit
69ad95a7b2
1 changed files with 3 additions and 1 deletions
|
|
@ -115,7 +115,8 @@ async function init(opts: { output?: string }) {
|
|||
{
|
||||
forgejoBaseUrl: () =>
|
||||
p.text({
|
||||
message: "Forgejo API URL (how Myst reaches Forgejo, not your browser URL)?",
|
||||
message:
|
||||
"Forgejo API URL (how Myst reaches Forgejo, not your browser URL)?",
|
||||
placeholder: "http://forgejo:3000",
|
||||
validate: (v) => validateHttpUrlOrHost(v, "Forgejo base URL"),
|
||||
}),
|
||||
|
|
@ -148,6 +149,7 @@ async function init(opts: { output?: string }) {
|
|||
|
||||
if (envExists) {
|
||||
const tempPath = envPath + ".tmp";
|
||||
await fs.unlink(tempPath).catch(() => {});
|
||||
await fs.writeFile(tempPath, envContent, {
|
||||
encoding: "utf8",
|
||||
flag: "wx",
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue