本文整理匯總了TypeScript中ember-cli/lib/models/project.nullProject函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript nullProject函數的具體用法?TypeScript nullProject怎麽用?TypeScript nullProject使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了nullProject函數的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: function
run: function (commandOptions: any, rawArgs: string[]) {
const packageName = rawArgs.shift();
if (!packageName) {
return Promise.reject(new SilentError(
`The "ng ${this.name}" command requires a name argument to be specified. ` +
`For more details, use "ng help".`));
}
commandOptions.name = packageName;
if (commandOptions.dryRun) {
commandOptions.skipGit = true;
}
if (packageName === '.') {
return Promise.reject(new SilentError(
`Trying to generate an application structure in this directory? Use "ng init" ` +
`instead.`));
}
if (!validProjectName(packageName)) {
return Promise.reject(
new SilentError(`We currently do not support a name of "${packageName}".`));
}
if (commandOptions.mobile) {
return Promise.reject(new SilentError(
'The --mobile flag has been disabled temporarily while we await an update of ' +
'angular-universal for supporting NgModule. Sorry for the inconvenience.'
));
}
commandOptions.blueprint = normalizeBlueprint(commandOptions.blueprint);
if (!commandOptions.directory) {
commandOptions.directory = packageName;
}
const createAndStepIntoDirectory =
new this.tasks.CreateAndStepIntoDirectory({ ui: this.ui, analytics: this.analytics });
const initCommand = new InitCommand({
ui: this.ui,
analytics: this.analytics,
tasks: this.tasks,
project: Project.nullProject(this.ui, this.cli)
});
return createAndStepIntoDirectory
.run({
directoryName: commandOptions.directory,
dryRun: commandOptions.dryRun
})
.then(initCommand.run.bind(initCommand, commandOptions, rawArgs));
}
示例2: function
run: function(commandOptions, rawArgs) {
const packageName = rawArgs.shift();
if (!packageName) {
return Promise.reject(new SilentError(
`The "ng ${this.name}" command requires a name argument to be specified. ` +
`For more details, use "ng help".`
));
}
commandOptions.name = packageName;
if (commandOptions.dryRun){
commandOptions.skipGit = true;
}
if (packageName === '.') {
return Promise.reject(new SilentError(
`Trying to generate an application structure in this directory? Use "ng init" ` +
`instead.`
));
}
if (!validProjectName(packageName)) {
return Promise.reject(new SilentError(
`We currently do not support a name of "${packageName}".`
));
}
commandOptions.blueprint = normalizeBlueprint(commandOptions.blueprint);
if (!commandOptions.directory) {
commandOptions.directory = packageName;
}
const createAndStepIntoDirectory = new this.tasks.CreateAndStepIntoDirectory({
ui: this.ui,
analytics: this.analytics
});
const initCommand = new InitCommand({
ui: this.ui,
analytics: this.analytics,
tasks: this.tasks,
project: Project.nullProject(this.ui, this.cli)
});
return createAndStepIntoDirectory
.run({
directoryName: commandOptions.directory,
dryRun: commandOptions.dryRun
})
.then(initCommand.run.bind(initCommand, commandOptions, rawArgs));
}