Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

Can use truffle init/unbox into a non-empty folder #953

Closed
hefgi opened this issue May 21, 2018 · 3 comments
Closed

Can use truffle init/unbox into a non-empty folder #953

hefgi opened this issue May 21, 2018 · 3 comments

Comments

@hefgi
Copy link

hefgi commented May 21, 2018

I'm asking for a feature request.

If we want to add truffle to an existing project, we need to copy/paste files manually because of this error :

$ truffle init                                                                                                                                                            
Downloading...
Error: Something already exists at the destination. Please unbox in an empty folder. Stopping to prevent overwriting data.
    at /Users/fjalcaraz/.nvm/versions/node/v8.11.1/lib/node_modules/truffle/build/webpack:/~/truffle-box/lib/utils/unbox.js:22:1
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:188:7)
    at Function.Module.runMain (module.js:695:11)
    at startup (bootstrap_node.js:188:16)
    at bootstrap_node.js:609:3

It would be great if truffle checked if files are going to be overwritten, if not, it can init, if yes, show this error message.

@cgewecke
Copy link
Contributor

cgewecke commented May 21, 2018

@hefgi Agree this would be nice, especially for truffle init. Cross referencing to truffle-core 117 which would solve several other issues as well.

Workaround

# From within a project that already has lots of contents
mkdir truffle-bare
cd truffle-bare
truffle init
cd ..
mv truffle-bare/* .
rm -rf truffle-bare

@gerchicov-bp
Copy link

@hefgi @cgewecke
The problem is for example the folder can contain system files. For example in OSX it is .DS_Store. So even if the folder looks like empty truffle rejects to work with it and requires a "Superempty" folder which contains zero system files.

@eggplantzzz
Copy link
Contributor

This feature has been added in version 5!

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

No branches or pull requests

4 participants