2020-03-16 05:58:00 +03:00
|
|
|
const path = require('path')
|
2020-12-23 01:14:52 +03:00
|
|
|
const os = require('os')
|
2020-03-16 05:58:00 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// =============
|
|
|
|
// === Paths ===
|
|
|
|
// =============
|
|
|
|
|
|
|
|
let paths = {}
|
|
|
|
|
|
|
|
paths.root = path.dirname(__dirname)
|
|
|
|
|
|
|
|
paths.script = {}
|
|
|
|
paths.script.main = path.join(paths.root,'run')
|
|
|
|
paths.script.root = path.join(paths.root,'build')
|
|
|
|
paths.script.run = path.join(paths.script.root,'run')
|
|
|
|
|
2021-02-02 08:07:43 +03:00
|
|
|
paths.github = {}
|
|
|
|
paths.github.root = path.join(paths.root,'.github')
|
|
|
|
paths.github.workflows = path.join(paths.github.root,'workflows')
|
|
|
|
|
2020-03-16 05:58:00 +03:00
|
|
|
paths.dist = {}
|
|
|
|
paths.dist.root = path.join(paths.root,'dist')
|
|
|
|
paths.dist.client = path.join(paths.dist.root,'client')
|
|
|
|
paths.dist.content = path.join(paths.dist.root,'content')
|
2020-12-23 01:14:52 +03:00
|
|
|
paths.dist.bin = path.join(paths.dist.root, 'bin')
|
2020-03-16 05:58:00 +03:00
|
|
|
paths.dist.init = path.join(paths.dist.root,'init')
|
2021-02-02 08:07:43 +03:00
|
|
|
paths.dist.buildInit = path.join(paths.dist.root,'build-init')
|
2020-03-16 05:58:00 +03:00
|
|
|
paths.dist.buildInfo = path.join(paths.dist.root,'build.json')
|
2021-08-30 14:57:30 +03:00
|
|
|
paths.dist.tmp = path.join(paths.dist.root,'tmp')
|
2020-03-16 05:58:00 +03:00
|
|
|
|
|
|
|
paths.dist.wasm = {}
|
|
|
|
paths.dist.wasm.root = path.join(paths.dist.root,'wasm')
|
2020-07-06 13:09:54 +03:00
|
|
|
paths.dist.wasm.main = path.join(paths.dist.wasm.root,'ide.wasm')
|
|
|
|
paths.dist.wasm.mainRaw = path.join(paths.dist.wasm.root,'ide_bg.wasm')
|
|
|
|
paths.dist.wasm.glue = path.join(paths.dist.wasm.root,'ide.js')
|
|
|
|
paths.dist.wasm.mainOpt = path.join(paths.dist.wasm.root,'ide_opt.wasm')
|
|
|
|
paths.dist.wasm.mainOptGz = path.join(paths.dist.wasm.root,'ide_opt.wasm.gz')
|
2020-03-16 05:58:00 +03:00
|
|
|
|
2021-01-21 16:52:57 +03:00
|
|
|
paths.js = {}
|
|
|
|
paths.js.lib = {}
|
|
|
|
paths.js.root = path.join(paths.root, 'src', 'js')
|
|
|
|
paths.js.lib.projectManager = path.join(paths.js.root, 'lib', 'project-manager')
|
2021-08-06 19:56:53 +03:00
|
|
|
paths.js.lib.content = path.join(paths.js.root, 'lib', 'content')
|
2020-03-16 05:58:00 +03:00
|
|
|
|
|
|
|
paths.rust = {}
|
|
|
|
paths.rust.root = path.join(paths.root,'src','rust')
|
|
|
|
|
2020-12-23 01:14:52 +03:00
|
|
|
function get_project_manager_extension() {
|
|
|
|
const target_platform = os.platform()
|
|
|
|
switch (target_platform) {
|
|
|
|
case 'win32':
|
|
|
|
return '.exe'
|
|
|
|
default:
|
|
|
|
return ''
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
paths.get_project_manager_path = function (root) {
|
|
|
|
let base_path = path.join(root, 'enso', 'bin',)
|
|
|
|
const extension = get_project_manager_extension()
|
|
|
|
return path.join(base_path, 'project-manager') + extension
|
|
|
|
}
|
|
|
|
|
2020-03-16 05:58:00 +03:00
|
|
|
module.exports = paths
|