tscoverage/ts/mod00/mod00.assets.ts

25 lines
927 B
TypeScript
Raw Normal View History

2017-01-18 00:58:09 +01:00
import * as q from 'smartq'
2016-10-05 12:27:30 +02:00
2016-10-21 17:48:52 +02:00
import paths = require('../npmts.paths')
import plugins = require('./mod00.plugins')
import { projectInfo } from '../mod00/mod00.check'
2016-03-14 04:32:52 +01:00
2017-01-18 00:58:09 +01:00
export let run = function(configArg){
2016-10-02 20:35:13 +02:00
let done = q.defer()
2016-09-06 17:21:25 +02:00
let config = configArg
2017-01-21 23:23:00 +01:00
plugins.beautylog.ora.text('now looking at ' + 'required assets'.yellow)
2016-09-06 17:21:25 +02:00
if (config.cli === true) {
2016-10-05 12:27:30 +02:00
let mainJsPath = projectInfo.packageJson.main
let cliJsString: string = plugins.smartfile.fs.toStringSync(plugins.path.join(paths.npmtsAssetsDir,'cli.js'))
cliJsString = cliJsString.replace('{{pathToIndex}}',mainJsPath)
plugins.smartfile.memory.toFsSync(cliJsString, plugins.path.join(paths.distDir,'cli.js'))
2016-09-06 17:21:25 +02:00
plugins.beautylog.ok('installed CLI assets!')
done.resolve(config)
2016-03-14 04:32:52 +01:00
} else {
2016-09-06 17:21:25 +02:00
plugins.beautylog.ok('No additional assets required!')
done.resolve(config)
2016-03-14 04:32:52 +01:00
}
2016-09-06 17:21:25 +02:00
return done.promise
}