Skip to content

Commit

Permalink
Merge pull request #16 from tsaxking/chore-update-scripts-to-013f50df…
Browse files Browse the repository at this point in the history
…c91ac84ce0e275fd613d15955d038c4b

Chore update scripts to 013f50d
  • Loading branch information
tsaxking authored Jan 25, 2024
2 parents 241189a + 8458d2d commit 6bd28fe
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions scripts/init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const createEnv = () => {
validation?: (data: string) => boolean,
allowBlank = true,
) => {
if (values[key]) return;
if (typeof env[key] !== 'undefined') return;
const value = runPrompt(message, defaultValue, validation, allowBlank);
if (value) {
values[key] = value;
Expand Down Expand Up @@ -127,12 +127,7 @@ const createEnv = () => {
);

const e = Object.keys(values)
.map(
(key) =>
`${toSnakeCase(fromCamelCase(key)).toUpperCase()} = '${
values[key]
}'`,
)
.map((key) => `${key} = '${values[key]}'`)
.join('\n');
Deno.writeTextFileSync(resolve(__root, './.env'), e);

Expand Down

0 comments on commit 6bd28fe

Please sign in to comment.