public async Task <bool> Install() { _command = new NpmInstallCommand( _npmController.FullPathToRootPackageDirectory, _npmController.PathToNpm); return(await DoCommandExecute(true)); }
public static async Task <bool> ExecuteAsync(NpmCommander commander, NpmCommand command) { using (var runner = new NmpCommandRunner(commander, command)) { return(await runner.command.ExecuteAsync()); } }
private void UnregisterLogEvents(NpmCommand command) { command.CommandStarted -= command_CommandStarted; command.OutputLogged -= command_OutputLogged; command.CommandCompleted -= command_CommandCompleted; command.ErrorLogged -= command_ErrorLogged; command.ExceptionLogged -= command_ExceptionLogged; }
public async Task <bool> ExecuteNpmCommandAsync(string arguments) { _command = new GenericNpmCommand( _npmController.FullPathToRootPackageDirectory, arguments, _npmController.PathToNpm); return(await DoCommandExecute(true)); }
private void UnregisterLogEvents(NpmCommand command) { command.CommandStarted -= command_CommandStarted; command.OutputLogged -= command_OutputLogged; command.CommandCompleted -= command_CommandCompleted; command.ErrorLogged -= command_ErrorLogged; command.ExceptionLogged -= command_ExceptionLogged; }
private async Task <bool> UpdatePackagesAsync(IEnumerable <IPackage> packages, bool global) { _command = new NpmUpdateCommand( _npmController.FullPathToRootPackageDirectory, packages, global, _npmController.PathToNpm); return(await DoCommandExecute(true)); }
private async Task <bool> UninstallPackageAsync(string packageName, bool global) { _command = new NpmUninstallCommand( _npmController.FullPathToRootPackageDirectory, packageName, GetDependencyType(packageName), global, _npmController.PathToNpm); return(await DoCommandExecute(true)); }
public async Task <IPackageCatalog> GetCatalogAsync(bool forceDownload, IProgress <string> progress) { _command = new NpmGetCatalogCommand( _npmController.FullPathToRootPackageDirectory, _npmController.CachePath, forceDownload, pathToNpm: _npmController.PathToNpm, progress: progress); await DoCommandExecute(false); return((_command as NpmGetCatalogCommand).Catalog); }
private NmpCommandRunner(NpmCommander commander, NpmCommand command) { this._commander = commander; this._command = command; _commander._executingCommand = command; _command.CommandStarted += _commander.command_CommandStarted; _command.OutputLogged += _commander.command_OutputLogged; _command.CommandCompleted += _commander.command_CommandCompleted; _command.ErrorLogged += _commander.command_ErrorLogged; _command.ExceptionLogged += _commander.command_ExceptionLogged; }
private NmpCommandRunner(NpmCommander commander, NpmCommand command) { this.commander = commander; this.command = command; this.commander.executingCommand = command; this.command.CommandStarted += this.commander.command_CommandStarted; this.command.OutputLogged += this.commander.command_OutputLogged; this.command.CommandCompleted += this.commander.command_CommandCompleted; this.command.ErrorLogged += this.commander.command_ErrorLogged; this.command.ExceptionLogged += this.commander.command_ExceptionLogged; }
private async Task <bool> DoCommandExecute(bool refreshNpmController, NpmCommand command) { Debug.Assert(_executingCommand == null, "Attempting to execute multiple commands at the same time."); try { bool success = await NmpCommandRunner.ExecuteAsync(this, command); if (refreshNpmController) { _npmController.Refresh(); } return(success); } catch (Exception e) { OnOutputLogged(e.ToString()); } return(false); }
private async Task <bool> InstallPackageByVersionAsync( string packageName, string versionRange, DependencyType type, bool global, bool saveToPackageJson) { _command = new NpmInstallCommand( _npmController.FullPathToRootPackageDirectory, packageName, versionRange, type, global, saveToPackageJson, _npmController.PathToNpm); return(await DoCommandExecute(true)); }
public NpmCommandRedirector(NpmCommand owner) { this.owner = owner; }
public async Task<bool> ExecuteNpmCommandAsync(string arguments) { _command = new GenericNpmCommand( _npmController.FullPathToRootPackageDirectory, arguments, _npmController.PathToNpm); return await DoCommandExecute(true); }
private async Task<bool> UpdatePackagesAsync(IEnumerable<IPackage> packages, bool global) { _command = new NpmUpdateCommand( _npmController.FullPathToRootPackageDirectory, packages, global, _npmController.PathToNpm); return await DoCommandExecute(true); }
public async Task<IPackageCatalog> GetCatalogAsync(bool forceDownload, IProgress<string> progress) { _command = new NpmGetCatalogCommand( _npmController.FullPathToRootPackageDirectory, _npmController.CachePath, forceDownload, pathToNpm:_npmController.PathToNpm, progress: progress); await DoCommandExecute(false); return (_command as NpmGetCatalogCommand).Catalog; }
private async Task<bool> UninstallPackageAsync(string packageName, bool global) { _command = new NpmUninstallCommand( _npmController.FullPathToRootPackageDirectory, packageName, GetDependencyType(packageName), global, _npmController.PathToNpm); return await DoCommandExecute(true); }
private async Task<bool> InstallPackageByVersionAsync( string packageName, string versionRange, DependencyType type, bool global, bool saveToPackageJson) { _command = new NpmInstallCommand( _npmController.FullPathToRootPackageDirectory, packageName, versionRange, type, global, saveToPackageJson, _npmController.PathToNpm); return await DoCommandExecute(true); }
private async Task<bool> DoCommandExecute(bool refreshNpmController, NpmCommand command) { Debug.Assert(_executingCommand == null, "Attempting to execute multiple commands at the same time."); try { bool success = await NmpCommandRunner.ExecuteAsync(this, command); if (refreshNpmController) { _npmController.Refresh(); } return success; } catch (Exception e) { OnOutputLogged(e.ToString()); } return false; }
public static async Task<bool> ExecuteAsync(NpmCommander commander, NpmCommand command) { using (var runner = new NmpCommandRunner(commander, command)) { return await runner._command.ExecuteAsync(); } }
public async Task<bool> Install() { _command = new NpmInstallCommand( _npmController.FullPathToRootPackageDirectory, _npmController.PathToNpm); return await DoCommandExecute(true); }
public NpmCommandRedirector(NpmCommand owner) { _owner = owner; }
public NpmCommandRedirector(NpmCommand owner) { _owner = owner; }