Fix windows support, fix other bugs

[?]
Feb 26, 2021, 9:33 AM
HVLXWD6AJ2ACJJJRBDL36OFIXWQ7VA3PEUEQJGRKXJFSJ2JORKSAC

Dependencies

  • [2] HF3NERPZ Add cache for changes and add change dependencies to log
  • [3] Q5X2TMMI Automatically detect Pijul executable under .cargo directory
  • [4] WW67NYZV Configure eslint for JS standard formatting
  • [5] NCBEWRYE Initialize Repository
  • [6] WHFIIX4Y Improve documentation and add Pijul installation configuration
  • [7] TKKT6D4C Add failure loop to installation selection
  • [8] B4SKYP3Y Add repository model and add steps to initialize it
  • [9] GNQD74OZ Add pijul.openChange command and text document provider for pijul-change scheme
  • [*] ZGMIJNFV Create pijul.ts for executing commands using the Pijul CLI
  • [*] ILH3GIVT Add command centre and refresh/init commands

Change contents

  • edit in src/pijul.ts at line 69
    [11.1834]
    [11.1834]
    // If on Windows, need to remove starting forward slash provided in the CWD by vscode
    if (process.platform === 'win32' && cwd) {
    const driveLetterRegExp = new RegExp('[A-Za-z]:');
    if (cwd.charAt(0) === '/' && driveLetterRegExp.test(cwd.substr(1, 2))) {
    cwd = cwd.substr(1);
    }
    }
  • replacement in src/pijul.ts at line 210
    [4.1137][4.1137:1268]()
    return (await this._pijul.exec(this.repositoryRoot, ['reset', uri.path, '--dry-run'], { cancellationToken: token })).stdout;
    [4.1137]
    [4.1268]
    return (await this._pijul.exec(this.repositoryRoot, ['reset', uri.fsPath, '--dry-run'], { cancellationToken: token })).stdout;
  • edit in src/pijul.ts at line 656
    [2.2170]
    [2.2170]
  • replacement in src/pijul.ts at line 663
    [2.2432][2.2432:2503]()
    throw new Error('Failed to parse author string: ' + authorString);
    [2.2432]
    [2.2503]
    // Blank author field, just return blank strings
    return new PijulChangeAuthor('<NO AUTHOR>', '', '');
  • replacement in src/extension.ts at line 26
    [4.1758][3.83:149]()
    // First, check if Pijul can be found in the .cargo directory
    [4.1758]
    [3.149]
    // First, check if Pijul is on $PATH.
    path = 'pijul';
  • replacement in src/extension.ts at line 29
    [3.159][3.159:287]()
    path = await searchPijulCargoDirectory(outputChannel);
    if (path) {
    return await checkPijulExecutable(path);
    [3.159]
    [3.287]
    if (process.platform === 'win32') {
    path += '.exe';
    }
    return await checkPijulExecutable(path);
    } catch (e) {
    // If not found, check if Pijul can be found in the .cargo directory
    try {
    path = await searchPijulCargoDirectory(outputChannel);
    if (path) {
    return await checkPijulExecutable(path);
    }
    } catch (_) {
    path = undefined;
  • edit in src/extension.ts at line 43
    [3.295][3.295:337]()
    } catch (_) {
    path = undefined;
  • edit in package.json at line 17
    [12.4203]
    [12.4203]
    "workspaceContains:.pijul",
  • replacement in build/node-extension.webpack.config.js at line 1
    [4.109638][4.109639:109651]()
    //@ts-check
    [4.109638]
    [4.109651]
    // @ts-check
  • replacement in build/node-extension.webpack.config.js at line 7
    [4.109698][4.109698:109743]()
    /**@type {import('webpack').Configuration}*/
    [4.109698]
    [4.109743]
    /** @type {import('webpack').Configuration} */
  • replacement in build/node-extension.webpack.config.js at line 10
    [4.109875][4.109875:110003]()
    mode: 'none', // this leaves the source code as close as possible to the original (when packaging we set this to 'production')
    [4.109875]
    [4.110003]
    mode: 'none', // this leaves the source code as close as possible to the original (when packaging we set this to 'production')
  • replacement in build/node-extension.webpack.config.js at line 41
    [4.110979][4.110979:111003]()
    module.exports = config;
    [4.110979]
    module.exports = config;
  • replacement in .vscode/tasks.json at line 9
    [4.22214][4.22214:22320]()
    "problemMatcher": [
    "$ts-webpack-watch",
    "$tslint-webpack-watch"
    ],
    [4.22214]
    [4.22320]
    "problemMatcher": {
    "owner": "typescript",
    "fileLocation": "relative",
    "background": {
    "activeOnStart": true,
    "beginsPattern": "webpack --watch --config .*$",
    "endsPattern": "webpack [\\.\\d]+ compiled successfully in \\d+ ms"
    },
    "pattern": [
    {
    "regexp": "ERROR in ([^\\(]*)\\((\\d+),(\\d+)\\):",
    "file": 1,
    "line": 2,
    "column": 3
    },
    {
    "regexp": "([A-Za-z0-9-]+):(.*)",
    "message": 2,
    "code": 1
    }
    ]
    },
  • replacement in .vscode/launch.json at line 10
    [4.23643][4.23643:23671]()
    "type": "extensionHost",
    [4.23643]
    [4.23671]
    "type": "pwa-extensionHost",
  • edit in .vscode/launch.json at line 18
    [4.23827]
    [4.23827]
    "sourceMaps": true,