Add commands to open repo and global pijul configuration files

[?]
Dec 29, 2020, 7:32 PM
6H4B4UJQ4PQULICKBZ5U55QU2BWIH2VNGRCUVYR7KDYOGC7MQU7QC

Dependencies

  • [2] VWRDBPJZ Add command and menu option for adding one or more files to the repository
  • [3] FAMBRMO7 Add command to open file to source control resources
  • [4] L44OILGK Add reset command to resource state context menu
  • [5] ILH3GIVT Add command centre and refresh/init commands
  • [*] B4SKYP3Y Add repository model and add steps to initialize it
  • [*] YUVLBWV3 Populate resource groups for unrecorded and untracked changes
  • [*] NCBEWRYE Initialize Repository
  • [*] MU6ZNUYZ Integrate recordAll command with input box

Change contents

  • edit in src/repository.ts at line 94
    [8.27]
    [7.1512]
    }
    get root (): Uri {
    return Uri.file(this.repository.root);
  • replacement in src/commands.ts at line 1
    [4.14][4.768:877]()
    import { commands, Disposable, OutputChannel, SourceControlResourceState, window, workspace } from 'vscode';
    [4.14]
    [4.96]
    import * as os from 'os';
    import * as path from 'path';
    import { commands, Disposable, OutputChannel, SourceControlResourceState, Uri, window, workspace } from 'vscode';
  • edit in src/commands.ts at line 197
    [3.348]
    [3.348]
    }
    }
    /**
    * Opens the repository's configuration file for editing
    * @param repository The repository which will have its config open.
    */
    @command('pijul.editRepoConfiguration', { repository: true })
    async editRepoConfiguration (repository: Repository): Promise<void> {
    await commands.executeCommand('vscode.open', Uri.file(path.join(repository.root.path, '.pijul', 'config')));
    }
    /**
    * Opens the global Pijul configuration file for editing
    */
    @command('pijul.editGlobalConfiguration')
    async editGlobalConfiguration (): Promise<void> {
    switch (os.platform()) {
    case 'darwin':
    await commands.executeCommand('vscode.open', Uri.file(path.join(os.homedir(), '.pijulconfig')));
    break;
    default:
    await commands.executeCommand('vscode.open', Uri.file(path.join(os.homedir(), '.config', 'pijul', 'config.toml')));
    break;
  • edit in package.json at line 70
    [3.454]
    [10.1961]
    "category": "Pijul"
    },
    {
    "command": "pijul.editRepoConfiguration",
    "title": "Edit Repository Configuration",
    "category": "Pijul"
    },
    {
    "command": "pijul.editGlobalConfiguration",
    "title": "Edit Global Configuration",
  • edit in package.json at line 104
    [2.1042]
    [2.1042]
    {
    "command": "pijul.editGlobalConfiguration",
    "when": "scmProvider == pijul",
    "group": "first"
    },
  • edit in package.json at line 110
    [2.1048]
    [2.1048]
    "command": "pijul.editRepoConfiguration",
    "when": "scmProvider == pijul",
    "group": "first"
    },
    {