Remote CLI fixes (#15117) (#15125)

* fixes from vscode

* update distro

* fix distro

* fix hygiene

* reorder hygiene

* Update distro

Co-authored-by: chgagnon <chgagnon@microsoft.com>
(cherry picked from commit 1b78008258)
This commit is contained in:
Aditya Bist
2021-04-13 21:15:22 -07:00
committed by GitHub
parent d4e25f4d89
commit ebe835ec99
5 changed files with 27 additions and 49 deletions

View File

@@ -11,20 +11,21 @@ export async function deactivate(): Promise<any> {
}
export async function activate(context: ExtensionContext): Promise<void> {
context.subscriptions.push(commands.registerCommand('git.credential', async (data: any) => {
try {
const { stdout, stderr } = await exec(`git credential ${data.command}`, {
stdin: data.stdin,
env: Object.assign(process.env, { GIT_TERMINAL_PROMPT: '0' })
});
return { stdout, stderr, code: 0 };
} catch ({ stdout, stderr, error }) {
const code = error.code || 0;
if (stderr.indexOf('terminal prompts disabled') !== -1) {
stderr = '';
}
return { stdout, stderr, code };
}
context.subscriptions.push(commands.registerCommand('git.credential', async (_data: any) => {
return { stdout: '', stderr: '', code: 0 };
// try {
// const { stdout, stderr } = await exec(`git credential ${data.command}`, {
// stdin: data.stdin,
// env: Object.assign(process.env, { GIT_TERMINAL_PROMPT: '0' })
// });
// return { stdout, stderr, code: 0 };
// } catch ({ stdout, stderr, error }) {
// const code = error.code || 0;
// if (stderr.indexOf('terminal prompts disabled') !== -1) {
// stderr = '';
// }
// return { stdout, stderr, code };
// }
}));
}