Skip to content

Commit

Permalink
commenting and clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
thescientist13 committed Oct 21, 2024
1 parent f93f9e4 commit d53353a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/init/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -255,11 +255,13 @@ const run = async () => {
try {
const firstArg = process.argv[process.argv.length - 1].split(' ')[0];
const taskRunner = program.yarn ? 'yarn' : 'npm run';
// bypassing commander here for my-app directory option, since I couldn't get it to work as an argument :/
// https://github.com/tj/commander.js?tab=readme-ov-file#command-arguments
const shouldChangeDirectory = !firstArg.startsWith('--') && firstArg !== '';
const shouldInstallDeps = program.install || program.yarn;
const instructions = [];

if (!firstArg.startsWith('--') && firstArg !== '') {
if (shouldChangeDirectory) {
TARGET_DIR = path.join(TARGET_DIR, `./${firstArg}`);

if (!fs.existsSync(TARGET_DIR)) {
Expand Down

0 comments on commit d53353a

Please sign in to comment.