Skip to content

Commit

Permalink
Fix command identifier
Browse files Browse the repository at this point in the history
Use ID of extension as prefix in command ID and title.
  • Loading branch information
grgar committed Mar 19, 2024
1 parent 91cb174 commit 0c0156c
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 21 deletions.
14 changes: 0 additions & 14 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,6 @@
"plugins": [
"@typescript-eslint"
],
"rules": {
"@typescript-eslint/naming-convention": [
"warn",
{
"selector": "import",
"format": [ "camelCase", "PascalCase" ]
}
],
"@typescript-eslint/semi": "warn",
"curly": "warn",
"eqeqeq": "warn",
"no-throw-literal": "warn",
"semi": "off"
},
"ignorePatterns": [
"out",
"dist",
Expand Down
24 changes: 24 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Changelog
### v0.1.1

- Fix command identifier

Use ID of extension as prefix in command ID and title.

### v0.1.0

- Create LICENSE


- Add support for multiple files

Use an object as config where each key-value is a file to be written.


- Scaffold to apply one file from settings

Adds some configuration options to write one file from settings to the configured (or defaulted) dotfiles folder.


- Initial commit

4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"url": "https://github.com/grgar/vscode-dotfiles"
},
"description": "Apply dotfiles from settings",
"version": "0.1.0",
"version": "0.1.1",
"license": "MIT",
"preview": true,
"engines": {
Expand All @@ -23,8 +23,8 @@
"contributes": {
"commands": [
{
"command": "config-setup.apply",
"title": "Apply Config from Config Setup"
"command": "dotfiles.apply",
"title": "dotfiles: Apply Config"
}
],
"configuration": {
Expand Down
4 changes: 2 additions & 2 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const configNamespace = "dotfiles";

async function apply() {
const config = vscode.workspace.getConfiguration(configNamespace);
const directory = config.get<string>("directory", process.env["XDG_CONFIG_DIR"] ?? path.join(process.env["HOME"]!, ".config"));
const directory = config.get<string>("directory") || process.env["XDG_CONFIG_DIR"] || path.join(process.env["HOME"]!, ".config");
const files = Object.entries(config.get<object>("files", {}));
for (const [file, content] of files) {
const filePath = path.join(directory, file);
Expand All @@ -24,7 +24,7 @@ async function apply() {
}

export function activate(context: vscode.ExtensionContext) {
context.subscriptions.push(vscode.commands.registerCommand('config-setup.apply', apply));
context.subscriptions.push(vscode.commands.registerCommand("dotfiles.apply", apply));
}

export function deactivate() { }

0 comments on commit 0c0156c

Please sign in to comment.