MiningSam
MiningSam

Reputation: 603

Force create existing folder with Meteor

When I use the command:

meteor create myfolder

It won't by default allow meteor to install itself if the folder is already existing. I can't find an option to force it. Is it really necessary that Meteor creates the directory by itself first or is this just because of 'good practice'?

I want to automate the creation of a folder first and run the meteor command afterwards, hence the question.

Upvotes: 0

Views: 104

Answers (1)

Andrew Mao
Andrew Mao

Reputation: 36940

Maybe you want a shell script like the following:

$DIR = <some variable>

if [ ! -f "$DIR" ]; then
    meteor create tempDir
    mv tempDir/* "$DIR/"
    rmdir tempDir
fi

which will copy the contents into your new directory, as long as it doesn't contain any Meteor files already.

Upvotes: 2

Related Questions