fix: display real value for the directory to cd to after init#415
Merged
Conversation
dikarel
commented
Jul 4, 2022
| await Deno.mkdir(join(directory, ".vscode"), { recursive: true }); | ||
| await Deno.mkdir(join(resolvedDirectory, ".vscode"), { recursive: true }); | ||
| } | ||
| if (useTwind) { |
Contributor
Author
There was a problem hiding this comment.
This re-format came from deno fmt. I think the rename of directory has caused the original line to exceed a column limit?
| } | ||
| const IMPORT_MAP_JSON = JSON.stringify(importMap, null, 2) + "\n"; | ||
| await Deno.writeTextFile(join(directory, "import_map.json"), IMPORT_MAP_JSON); | ||
| await Deno.writeTextFile( |
Contributor
Author
There was a problem hiding this comment.
This re-format also came from deno fmt
dikarel
commented
Jul 4, 2022
| // not leak personal info (e.g. `/Users/MyName`) | ||
| console.log("\n%cProject created!", "color: green; font-weight: bold"); | ||
| console.log("\`cd my-project\` to enter to the project directory."); | ||
| console.log(`\`cd ${unresolvedDirectory}\` to enter to the project directory.`); |
Contributor
Author
There was a problem hiding this comment.
Alternate approach: Why not just print Deno.args[0] here?
I think that would make the concern of reading from command line args less DRY. "reading from command line args" feels like one of those areas where making a mistake would be impactful, so it felt important to optimize for DRY-ness there.
This was referenced Jul 5, 2022
GuillaumeBibaut
pushed a commit
to GuillaumeBibaut/fresh
that referenced
this pull request
Jul 6, 2022
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes the output of the
initscript, so that it instructs the user tocdinto the directory that the user specifies (rather than a hard-codedmy-project)Why this change?
It can be confusing to the user to see a prompt to
cdtomy-project, when the user specifies a different directory forinit. It's extra confusing for folks who are newer to programming or are trying to on-board by following tutorials, so I think this might hurt adoption if not fixed.Test plan:
deno fmt init.tsto catch lint violationsdeno task testto catch test failuresdeno run -A init.ts todo-listto verify that thecdmessage is correct