proc.run([ 'build', '-f', path.resolve(process.cwd(), dockerfile) ].concat(tagArgs).concat([process.cwd()]) ).then(() => { output.line() output.success('Image built successfully!') return tags[tags.length - 1] }).catch(e => { output.line() output.error('Build failed') throw e })
vols.map((v) => v.startsWith('.') ? path.resolve(process.cwd(), v) : v)
describe('get', () => { before(() => { config.defaultPath = path.resolve(__dirname, '../fixtures/binci.yml') }) it('returns false if no services are specified', () => { expect(services.get({})).to.be.false() }) it('returns an array of services and their command arrays', () => { const svc = services.get(_.merge({ rmOnShutdown: false }, config.load())) expect(svc[0].name).to.equal('mongodb') expect(svc[0].args).to.deep.equal(['run', '-d', '--privileged', '--rm', '-p', '27017:27017', '--name', 'bc_mongodb_test', 'mongo:3.0']) }) it('returns an array of services and their command arrays (with rmOnShutdown)', () => { const svc = services.get(_.merge({ rmOnShutdown: true }, config.load())) expect(svc[0].name).to.equal('mongodb') expect(svc[0].args).to.deep.equal(['run', '-d', '--privileged', '-p', '27017:27017', '--name', 'bc_mongodb_test', 'mongo:3.0']) }) })
constructor() { const cache = this.cache = {}; const factory = function (storageFile) { let realPath = path.resolve(global.settings.dataFolder, storageFile); if (!realPath.endsWith('.json')) { realPath += '.json'; } return cache[storageFile] || (cache[storageFile] = new StorageAdapter(realPath)); }; factory.saveAll = this.saveAll.bind(this); return factory; }
(process.env.NODE_PATH || '') .split(path.delimiter) .filter(folder => folder && !path.isAbsolute(folder)) .map(folder => path.resolve(appDirectory, folder)) .join(path.delimiter)
app.use('/', function renderApp(req, res) { const filePath = path.resolve(__dirname, '..', 'build', 'index.html'); fs.readFile(filePath, { encoding: 'utf-8' }, function render(err, html) { if (err) { return res.status(404).end(); } return serverRender(req, res, html); }); });
checkCreate( cmd, type ) { return new Promise((resolve, reject) => { const createdFile = type === 'page' ? path.resolve(this.srcPaths.page, cmd.name) : (type === 'project' ? path.resolve(this.srcPaths.project.root, cmd.name) : path.resolve(this.srcPaths[type], `${cmd.name}.js`)); if(existsSync(createdFile)) return reject(`${createdFile} alredy exists`); return resolve(cmd); }) }
Cache.once(async (baseUrl) => { let rexp = /\/(main\.[^\.]+\.(?:js|css))/g; let html = await readFile(path.resolve(assetsFolder, 'index.html')); return html.toString().replace(rexp, `${baseUrl}/$1`); })
(process.env.NODE_PATH || '') .split(path.delimiter) .filter(folder => folder && !path.isAbsolute(folder)) .map(folder => path.resolve(appDirectory, folder)) .join(path.delimiter)
(process.env.NODE_PATH || '') .split(path.delimiter) .filter(folder => folder && !path.isAbsolute(folder)) .map(folder => path.resolve(appDirectory, folder)) .join(path.delimiter)
app.use('/', function index(req, res) { const filePath = path.resolve(__dirname, '..', 'build', 'index.html'); fs.readFile(filePath, { encoding: 'utf-8' }, function renderHtml(err, html) { if (err) { return res.status(404).end(); } return serverRender(req, res, html); }); });
(process.env.NODE_PATH || '') .split(path.delimiter) .filter(folder => folder && !path.isAbsolute(folder)) .map(folder => path.resolve(appDirectory, folder)) .join(path.delimiter)
(process.env.NODE_PATH || '') .split(path.delimiter) .filter(folder => folder && !path.isAbsolute(folder)) .map(folder => path.resolve(appDirectory, folder)) .join(path.delimiter)