Merge commit 'be3e8236086165e5e45a5a10783823874b3f3ebd' as 'lib/vscode'
This commit is contained in:
8
lib/vscode/extensions/git-ui/.vscodeignore
Normal file
8
lib/vscode/extensions/git-ui/.vscodeignore
Normal file
@ -0,0 +1,8 @@
|
||||
src/**
|
||||
test/**
|
||||
out/**
|
||||
tsconfig.json
|
||||
build/**
|
||||
extension.webpack.config.js
|
||||
cgmanifest.json
|
||||
yarn.lock
|
7
lib/vscode/extensions/git-ui/README.md
Normal file
7
lib/vscode/extensions/git-ui/README.md
Normal file
@ -0,0 +1,7 @@
|
||||
# Git UI integration for Visual Studio Code
|
||||
|
||||
**Notice:** This extension is bundled with Visual Studio Code. It can be disabled but not uninstalled.
|
||||
|
||||
## Features
|
||||
|
||||
See [Git support in VS Code](https://code.visualstudio.com/docs/editor/versioncontrol#_git-support) to learn about the features of this extension.
|
4
lib/vscode/extensions/git-ui/cgmanifest.json
Normal file
4
lib/vscode/extensions/git-ui/cgmanifest.json
Normal file
@ -0,0 +1,4 @@
|
||||
{
|
||||
"registrations": [],
|
||||
"version": 1
|
||||
}
|
17
lib/vscode/extensions/git-ui/extension.webpack.config.js
Normal file
17
lib/vscode/extensions/git-ui/extension.webpack.config.js
Normal file
@ -0,0 +1,17 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
//@ts-check
|
||||
|
||||
'use strict';
|
||||
|
||||
const withDefaults = require('../shared.webpack.config');
|
||||
|
||||
module.exports = withDefaults({
|
||||
context: __dirname,
|
||||
entry: {
|
||||
main: './src/main.ts'
|
||||
}
|
||||
});
|
30
lib/vscode/extensions/git-ui/package.json
Normal file
30
lib/vscode/extensions/git-ui/package.json
Normal file
@ -0,0 +1,30 @@
|
||||
{
|
||||
"name": "git-ui",
|
||||
"displayName": "%displayName%",
|
||||
"description": "%description%",
|
||||
"publisher": "vscode",
|
||||
"version": "1.0.0",
|
||||
"engines": {
|
||||
"vscode": "^1.5.0"
|
||||
},
|
||||
"extensionKind": [
|
||||
"ui"
|
||||
],
|
||||
"aiKey": "AIF-d9b70cd4-b9f9-4d70-929b-a071c400b217",
|
||||
"enableProposedApi": true,
|
||||
"categories": [
|
||||
"Other"
|
||||
],
|
||||
"activationEvents": [
|
||||
"onCommand:git.credential"
|
||||
],
|
||||
"main": "./out/main",
|
||||
"icon": "resources/icons/git.png",
|
||||
"scripts": {
|
||||
"compile": "gulp compile-extension:git-ui",
|
||||
"watch": "gulp watch-extension:git-ui"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^12.11.7"
|
||||
}
|
||||
}
|
4
lib/vscode/extensions/git-ui/package.nls.json
Normal file
4
lib/vscode/extensions/git-ui/package.nls.json
Normal file
@ -0,0 +1,4 @@
|
||||
{
|
||||
"displayName": "Git UI",
|
||||
"description": "Git SCM UI Integration"
|
||||
}
|
BIN
lib/vscode/extensions/git-ui/resources/icons/git.png
Normal file
BIN
lib/vscode/extensions/git-ui/resources/icons/git.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.3 KiB |
57
lib/vscode/extensions/git-ui/src/main.ts
Normal file
57
lib/vscode/extensions/git-ui/src/main.ts
Normal file
@ -0,0 +1,57 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { ExtensionContext, commands } from 'vscode';
|
||||
|
||||
import * as cp from 'child_process';
|
||||
|
||||
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 };
|
||||
}
|
||||
}));
|
||||
}
|
||||
|
||||
export interface ExecResult {
|
||||
error: Error | null;
|
||||
stdout: string;
|
||||
stderr: string;
|
||||
}
|
||||
|
||||
|
||||
export function exec(command: string, options: cp.ExecOptions & { stdin?: string } = {}) {
|
||||
return new Promise<ExecResult>((resolve, reject) => {
|
||||
const child = cp.exec(command, options, (error, stdout, stderr) => {
|
||||
(error ? reject : resolve)({ error, stdout, stderr });
|
||||
});
|
||||
if (options.stdin) {
|
||||
child.stdin!.write(options.stdin, (err: any) => {
|
||||
if (err) {
|
||||
reject(err);
|
||||
return;
|
||||
}
|
||||
child.stdin!.end((err: any) => {
|
||||
if (err) {
|
||||
reject(err);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
8
lib/vscode/extensions/git-ui/src/typings/refs.d.ts
vendored
Normal file
8
lib/vscode/extensions/git-ui/src/typings/refs.d.ts
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
/// <reference path='../../../../src/vs/vscode.d.ts'/>
|
||||
/// <reference path='../../../../src/vs/vscode.proposed.d.ts'/>
|
||||
/// <reference types='@types/node'/>
|
13
lib/vscode/extensions/git-ui/tsconfig.json
Normal file
13
lib/vscode/extensions/git-ui/tsconfig.json
Normal file
@ -0,0 +1,13 @@
|
||||
{
|
||||
"extends": "../shared.tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"outDir": "./out",
|
||||
"experimentalDecorators": true,
|
||||
"typeRoots": [
|
||||
"./node_modules/@types"
|
||||
]
|
||||
},
|
||||
"include": [
|
||||
"src/**/*"
|
||||
]
|
||||
}
|
8
lib/vscode/extensions/git-ui/yarn.lock
Normal file
8
lib/vscode/extensions/git-ui/yarn.lock
Normal file
@ -0,0 +1,8 @@
|
||||
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
|
||||
# yarn lockfile v1
|
||||
|
||||
|
||||
"@types/node@^12.11.7":
|
||||
version "12.11.7"
|
||||
resolved "https://registry.yarnpkg.com/@types/node/-/node-12.11.7.tgz#57682a9771a3f7b09c2497f28129a0462966524a"
|
||||
integrity sha512-JNbGaHFCLwgHn/iCckiGSOZ1XYHsKFwREtzPwSGCVld1SGhOlmZw2D4ZI94HQCrBHbADzW9m4LER/8olJTRGHA==
|
Reference in New Issue
Block a user