README has a wrong command to run project locally for TypeScript

I’m doing “Build Your Own Git” in TypeScript.

The README states:

Run ./your_git.sh to run your Git implementation, which is implemented in app/main.ts.

Inside your_git.sh, though, the command is:

#!/bin/sh
#
# DON'T EDIT THIS!
#
# CodeCrafters uses this file to test your code. Don't make any changes here!
#
# DON'T EDIT THIS!
exec bun run /app/app/main.ts "$@"

Which is what CodeCrafters uses it to run it on the CI, probably inside a Docker container.

My point being that this command doesn’t work locally, as there is no /app/app/main.ts locally.

There is an (undocumented) npm script to run the project:

  "scripts": {
    "dev": "bun run app/main.ts"
  }

The README goes on about how I should create a mygit alias to point to your_git.sh, which, again, won’t work locally. Also, aliasing npm run dev won’t work as expected if I run it from another folder.

All in all, it is frustrating to spend time following a documentation that is not working properly, so I suggest you give it a look.

Thanks

1 Like

Hi there!

Thanks for reporting this. We fixed this yesterday, PR: Don't rely on /app for typescript builds by rohitpaulk · Pull Request #95 · codecrafters-io/build-your-own-git · GitHub.

All new repositories will be created with these changes, but for old repositories you’ll need to change your your_git.sh manually based on the diffs in the PR above.

Relevant section:

Hope this helps!

And good point re: dev not being usable since it doesn’t work across directories. I’ll see if we can get this removed

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.