Skip to content

Commit 05b25cd

Browse files
committed
Initial code commit
1 parent a734ddb commit 05b25cd

17 files changed

+3223
-0
lines changed

.eslintrc.json

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"env": {
3+
"browser": false,
4+
"commonjs": true,
5+
"es6": true,
6+
"node": true
7+
},
8+
"parserOptions": {
9+
"ecmaFeatures": {
10+
"jsx": true
11+
},
12+
"sourceType": "module"
13+
},
14+
"rules": {
15+
"no-const-assign": "warn",
16+
"no-this-before-super": "warn",
17+
"no-undef": "warn",
18+
"no-unreachable": "warn",
19+
"no-unused-vars": "warn",
20+
"constructor-super": "warn",
21+
"valid-typeof": "warn"
22+
}
23+
}

.gitattributes

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Set default behavior to automatically normalize line endings.
2+
* text=auto
3+

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
node_modules
2+
.vscode-test/
3+
*.vsix

.vscode/extensions.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
// See http://go.microsoft.com/fwlink/?LinkId=827846
3+
// for the documentation about the extensions.json format
4+
"recommendations": [
5+
"dbaeumer.vscode-eslint"
6+
]
7+
}

.vscode/launch.json

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
// A launch configuration that launches the extension inside a new window
2+
// Use IntelliSense to learn about possible attributes.
3+
// Hover to view descriptions of existing attributes.
4+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5+
{
6+
"version": "0.2.0",
7+
"configurations": [
8+
{
9+
"name": "Extension",
10+
"type": "extensionHost",
11+
"request": "launch",
12+
"runtimeExecutable": "${execPath}",
13+
"args": [
14+
"--extensionDevelopmentPath=${workspaceFolder}"
15+
]
16+
},
17+
{
18+
"name": "Extension Tests",
19+
"type": "extensionHost",
20+
"request": "launch",
21+
"runtimeExecutable": "${execPath}",
22+
"args": [
23+
"--extensionDevelopmentPath=${workspaceFolder}",
24+
"--extensionTestsPath=${workspaceFolder}/test"
25+
]
26+
}
27+
]
28+
}

.vscode/settings.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
// Place your settings in this file to overwrite default and user settings.
2+
{
3+
}

.vscodeignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
.vscode/**
2+
.vscode-test/**
3+
test/**
4+
.gitignore
5+
jsconfig.json
6+
vsc-extension-quickstart.md
7+
.eslintrc.json

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Change Log
2+
All notable changes to the "aws-cli-configure" extension will be documented in this file.
3+
4+
Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how to structure this file.
5+
6+
## [Unreleased]
7+
- Initial release

LICENSE.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
Visual Studio Code Extension for AWS CLI
2+
3+
Copyright (c) Mark Tucker
4+
5+
All rights reserved.
6+
7+
MIT License
8+
9+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ""Software""), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
10+
11+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
12+
13+
THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

extension.js

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
// The module 'vscode' contains the VS Code extensibility API
2+
// Import the module and reference it with the alias vscode in your code below
3+
const vscode = require('vscode');
4+
const path = require('path');
5+
const os = require('os');
6+
const opn = require('opn');
7+
const fs = require('fs');
8+
9+
10+
function openCredentialsFile(previewFlag = true) {
11+
12+
openFile(path.join(os.homedir(), '.aws', 'credentials'), previewFlag);
13+
14+
}
15+
16+
function openConfigFile(previewFlag = true) {
17+
18+
openFile(path.join(os.homedir(), '.aws', 'config'), previewFlag);
19+
}
20+
21+
function openBothFiles() {
22+
23+
openCredentialsFile(false);
24+
openConfigFile(false);
25+
26+
}
27+
28+
function openFile(filePath, previewFlag) {
29+
30+
if (fs.existsSync(filePath)) {
31+
vscode.workspace.openTextDocument(filePath)
32+
.then(doc => vscode.window.showTextDocument(doc, { preview: previewFlag }))
33+
}
34+
else {
35+
vscode.window.showInformationMessage(`File '${filePath}' does not exist.`);
36+
}
37+
38+
}
39+
40+
function openOnlineDocs() {
41+
42+
opn('https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-getting-started.html');
43+
44+
}
45+
46+
// this method is called when your extension is activated
47+
// your extension is activated the very first time the command is executed
48+
49+
function activate(context) {
50+
51+
context.subscriptions.push(vscode.commands.registerCommand('extension.openCredentialsFile', openCredentialsFile));
52+
context.subscriptions.push(vscode.commands.registerCommand('extension.openConfigFile', openConfigFile));
53+
context.subscriptions.push(vscode.commands.registerCommand('extension.openBothFiles', openBothFiles));
54+
context.subscriptions.push(vscode.commands.registerCommand('extension.openOnlineDocs', openOnlineDocs));
55+
56+
};
57+
58+
59+
60+
// this method is called when your extension is deactivated
61+
function deactivate() {
62+
}
63+
64+
65+
66+
exports.activate = activate;
67+
exports.deactivate = deactivate;

0 commit comments

Comments
 (0)