forked from quasarframework/quasar
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
app-paths.js
52 lines (44 loc) · 1.29 KB
/
app-paths.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
const fs = require('fs')
const { normalize, resolve, join, sep } = require('path')
function getAppDir () {
let dir = process.cwd()
while (dir.length && dir[dir.length - 1] !== sep) {
if (fs.existsSync(join(dir, 'quasar.conf.js'))) {
return dir
}
dir = normalize(join(dir, '..'))
}
const { fatal } = require('./helpers/logger')
fatal(`Error. This command must be executed inside a Quasar v1+ project folder.\n`)
}
const appDir = getAppDir()
const cliDir = resolve(__dirname, '..')
const srcDir = resolve(appDir, 'src')
const pwaDir = resolve(appDir, 'src-pwa')
const ssrDir = resolve(appDir, 'src-ssr')
const cordovaDir = resolve(appDir, 'src-cordova')
const capacitorDir = resolve(appDir, 'src-capacitor')
const electronDir = resolve(appDir, 'src-electron')
const bexDir = resolve(appDir, 'src-bex')
module.exports = {
cliDir,
appDir,
srcDir,
pwaDir,
ssrDir,
cordovaDir,
capacitorDir,
electronDir,
bexDir,
resolve: {
cli: dir => join(cliDir, dir),
app: dir => join(appDir, dir),
src: dir => join(srcDir, dir),
pwa: dir => join(pwaDir, dir),
ssr: dir => join(ssrDir, dir),
cordova: dir => join(cordovaDir, dir),
capacitor: dir => join(capacitorDir, dir),
electron: dir => join(electronDir, dir),
bex: dir => join(bexDir, dir)
}
}