Vue-cli: Sitting build path to '/' wiped my drive

Created on 6 Feb 2019  路  3Comments  路  Source: vuejs/vue-cli

Version

3.4.0

Environment info

Environment Info:

  System:
    OS: Windows 10
    CPU: (8) x64 Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz
  Binaries:
    Node: 11.0.0 - C:\Program Files\nodejs\node.EXE
    Yarn: Not Found
    npm: 6.4.1 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Edge: 44.18329.1.0
  npmGlobalPackages:
    @vue/cli: Not Found

Steps to reproduce

use vue UI
Create a project and set the build path to '/'
start build

What is expected?

I thought that it would build on the same directory

What is actually happening?

It wiped off the whole drive and got stuck


Obviously this is really dumb from my side and it's totally my mistake, but i think there should be a confirmation, a warning or something if such a parameter is provided.

enhancement

Most helpful comment

Sorry to hear that. We can definitely warn if / is provided...
If we want to be extra careful, we can do a heuristic check based on the file layout to see if it looks like a typical dist folder (with only .js and .css files etc.)

All 3 comments

Sorry to hear that. We can definitely warn if / is provided...
If we want to be extra careful, we can do a heuristic check based on the file layout to see if it looks like a typical dist folder (with only .js and .css files etc.)

Yes that would be optimal

Oh, the same thing happened to me! i lost my data :-(

Was this page helpful?
0 / 5 - 0 ratings