Force create existing folder with Meteor

时间:2015-07-28 22:18:44

标签: 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.

1 个答案:

答案 0 :(得分:2)

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.