Skip to content

bsb -init fails if bsb already exists(!) #2945

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
ELLIOTTCABLE opened this issue Jul 15, 2018 · 1 comment · Fixed by #2958
Closed

bsb -init fails if bsb already exists(!) #2945

ELLIOTTCABLE opened this issue Jul 15, 2018 · 1 comment · Fixed by #2958

Comments

@ELLIOTTCABLE
Copy link
Contributor

ELLIOTTCABLE commented Jul 15, 2018

$ bsb -theme minimal -init .
Fatal error: exception Unix.Unix_error(Unix.EEXIST, "mkdir", "./src")
$ rm -r src/
$ bsb -theme minimal -init .
Symlink bs-platform in /Users/ec/Dropbox/Code/wrange/.
Fatal error: exception Unix.Unix_error(Unix.EEXIST, "symlink", "node_modules/.bin/bsb")
$ rm -r node_modules/
$ bsb -theme minimal -init .
zsh: command not found: bsb

Welp.

I understand bs-platform is intended to be installed globally, but it unnecessarily vendors in a bunch of OCaml tooling I already have for my other projects (relevant, of course, is #404: BSB / Reason with existing OCaml setup / Merlin is underdocumented); and there's no way to install just bsc and bsb (this project badly needs some refactoring/modularization! I should, ideally, just be able to npm install --save-dev bs-compiler bs-build-system, and not deal with any of this, y'know?)

So, anyway, for this Issue, bsb -init ./ should more gracefully handle existing filesystem contents when initializing the current directory. Especially given that, if you install bs-platform for a single project or just to experiment with it, this means bsb -init is going to wipe out bsb itself.

The workaround, obviously, if anybody else runs into this before a fix is landed, is to install bsb in an adjacent directory and/or globally, and then bsb -init your_project from scratch.

@bobzhang
Copy link
Member

bobzhang commented Jul 16, 2018

To summarize, the issue is with a local installed bsb, the bsb -init would not work

bobzhang added a commit that referenced this issue Jul 24, 2018
when file or dir already exists it will continue initialization with some needed checks
fix #2945 #2500
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants