Skip to content
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

Error creating new project #46

Closed
012e opened this issue May 15, 2022 · 12 comments
Closed

Error creating new project #46

012e opened this issue May 15, 2022 · 12 comments

Comments

@012e
Copy link
Contributor

012e commented May 15, 2022

I followed the instruction to install bud, and bud create app doesn't work

bud

  • OS: Arch linux
  • go: version 1.18.2
  • node: v14.19.2
@syke99
Copy link
Contributor

syke99 commented May 15, 2022

This is due to trying to move/rename files across partitions. /tmp/bud-create- Seems to not exist in whichever partition bud is expecting it to be. I’ve not looked at the source code, so not sure what functionality is needed/should be changed (MoveFile(source, destination) might work, but I’m not sure). But this should give someone who’s more familiar a good jumping off point

@matthewmueller
Copy link
Contributor

matthewmueller commented May 15, 2022

Thanks for opening this issue and trying out Bud @012e!

As @syke99 mentioned, this is a known issue with partitions. We're already tracking it in #30, where I've written the planned next steps.

I'm going to close this issue as a duplicate of #30.

@012e
Copy link
Contributor Author

012e commented May 15, 2022

This is weird, I didn't put my /tmp in a different partition.

But I do have other un-formatted OS partitions with /tmp folder inside of it.

What bud create did to my /tmp folder:
image

image

@matthewmueller
Copy link
Contributor

matthewmueller commented May 15, 2022

Hmm, okay. It might be something different then, re-opening.

If you could try narrowing this down in the codebase, that'd be much appreciated. The create logic is in this package and I created a Contributing Guide today to help people get Bud installed locally. Happy to answer any questions that pop up.

Otherwise I'm still going to go with the plan in this comment and we'll try again once that's ready.

@012e
Copy link
Contributor Author

012e commented May 15, 2022

@matthewmueller I have just done a setup and tried to go run main.go create app
What happened:
image
Edit: It should be go run main.go create app (without the -C)

@matthewmueller
Copy link
Contributor

Sweet! From your error it looks like the problem is coming from this code block:

if err := os.Rename(tmpDir, dir); err != nil {
// Can't rename on top of an existing directory
if !errors.Is(err, fs.ErrExist) {
return err
}
// Move inner files over
fis, err := os.ReadDir(tmpDir)
if err != nil {
return err
}
for _, fi := range fis {
if err := os.Rename(filepath.Join(tmpDir, fi.Name()), filepath.Join(dir, fi.Name())); err != nil {
return err
}
}
}

Can you confirm?

@matthewmueller
Copy link
Contributor

@012e Would you mind pulling down the branch in the following PR and testing if this fixes your problem? #50

@012e
Copy link
Contributor Author

012e commented May 16, 2022

Still not working, but bud create app created an unfinished project in the same directory like the previous /tmp/bud-create-, probably something is wrong with npm's permissions
image

Do you need the log @matthewmueller?

@matthewmueller
Copy link
Contributor

matthewmueller commented May 16, 2022

@012e Ah, this is a different error and actually only a problem in the development build, not the production build. We symlink the JS runtime so you can make changes in the local bud repo and see those changes in your example projects.

From within the unfinished project directory, please try running the following:

npm link livebud $DIR_WHERE_YOU_GIT_CLONED_BUD/livebud

This should fail in the same way. I guess because of lack of npm permissions. I guess you could fix this with sudo npm.

@012e
Copy link
Contributor Author

012e commented May 16, 2022

Working perfectly @matthewmueller! BTW, my default website zoom is 120% (Firefox browser), and the cards are covering the footer
image

Closing this issue!

@matthewmueller
Copy link
Contributor

@012e happy to hear! Did the sudo npm work for you?

Also created an issue on the welcome page: livebud/welcome#1

@012e
Copy link
Contributor Author

012e commented May 16, 2022

@012e happy to hear! Did the sudo npm work for you?

Also created an issue on the welcome page: livebud/welcome#1

sudo npm link livebud $DIR_WHERE_YOU_GIT_CLONED_BUD/livebud

Update: I think this is the better solution
That's how I fixed the problem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants