Skip to content

Commit

Permalink
fix app name automatically
Browse files Browse the repository at this point in the history
  • Loading branch information
kentcdodds committed Mar 21, 2022
1 parent c340f44 commit 129d00d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion remix.init/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@ async function main({ rootDirectory }) {

const DIR_NAME = path.basename(rootDirectory);
const SUFFIX = getRandomString(2);
const APP_NAME = DIR_NAME + "-" + SUFFIX;

const APP_NAME = (DIR_NAME + "-" + SUFFIX)
// get rid of anything that's not allowed in an app name
.replace(/[^a-zA-Z0-9-_]/g, "-");

const [prodContent, readme, env, packageJson] = await Promise.all([
fs.readFile(FLY_TOML_PATH, "utf-8"),
Expand Down

0 comments on commit 129d00d

Please sign in to comment.