rcFolder.js 612 B

1234567891011121314151617181920212223
  1. const fs = require('fs-extra')
  2. const path = require('path')
  3. const { getRcPath } = require('@vue/cli/lib/util/rcPath')
  4. let folder
  5. if (process.env.VUE_CLI_UI_TEST) {
  6. folder = path.resolve(__dirname, '../../live-test')
  7. // Clean DB
  8. fs.removeSync(path.resolve(__dirname, folder))
  9. } else if (process.env.VUE_APP_CLI_UI_DEV) {
  10. folder = path.resolve(__dirname, '../../live')
  11. } else {
  12. folder =
  13. (process.env.VUE_CLI_UI_DB_PATH &&
  14. path.resolve(__dirname, process.env.VUE_CLI_UI_DB_PATH)) ||
  15. getRcPath('.vue-cli-ui')
  16. }
  17. fs.ensureDirSync(path.resolve(__dirname, folder))
  18. exports.rcFolder = folder