Skip to content
This repository was archived by the owner on Dec 8, 2020. It is now read-only.

Don't update rustup #244

Merged
merged 1 commit into from
May 17, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 0 additions & 16 deletions src/components/configuration/Rustup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,22 +92,6 @@ export class Rustup {
return this.pathToRlsExecutable;
}

/**
* Requests Rustup update
* @return true if no error occurred otherwise false
*/
public async update(): Promise<boolean> {
const args = ['self', 'update'];

const stdoutData: string | undefined = await this.invokeRustup(args);

if (stdoutData === undefined) {
return false;
}

return true;
}

/**
* Requests Rustup install RLS
* @return true if no error occurred and RLS has been installed otherwise false
Expand Down
22 changes: 0 additions & 22 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,17 +60,6 @@ async function askPermissionToInstallRls(logger: RootLogger): Promise<RlsInstall
}
}

/**
* Asks a user if the user agrees to update Rustup
* @returns true if a user agreed to update otherwise false
*/
async function askPermissionToUpdateRustup(): Promise<boolean> {
const message = 'Before installing RLS it would be good to update Rustup. If you decline to update, RLS will not be installed';
const updateChoice = 'Update';
const choice = await window.showInformationMessage(message, updateChoice);
return choice === updateChoice;
}

/**
* Handles the case when the user does not have RLS.
* It tries to install RLS if it is possible
Expand Down Expand Up @@ -100,17 +89,6 @@ async function handleMissingRls(logger: RootLogger, configuration: Configuration
case RlsInstallDecision.NotInstall:
return;
}
const permissionToUpdateRustupGranted: boolean = await askPermissionToUpdateRustup();
functionLogger.debug(`permissionToUpdateRustupGranted=${permissionToUpdateRustupGranted}`);
if (!permissionToUpdateRustupGranted) {
return;
}
const rustupUpdated: boolean = await rustup.update();
functionLogger.debug(`rustupUpdated=${rustupUpdated}`);
if (!rustupUpdated) {
window.showErrorMessage('Rustup failed to update. Check the output channel "Rust Logging"');
return;
}
async function installComponent(componentName: string, installComponent: () => Promise<boolean>): Promise<boolean> {
window.showInformationMessage(`${componentName} is being installed. It can take a while`);
const componentInstalled: boolean = await installComponent();
Expand Down