Update file change parsing regex to also handle 'File addition: "<filename>"' format

[?]
Jan 15, 2021, 9:19 PM
5DKNE57725UBCU5Z325JA2T3VTMW6RTIQJKZTUQNCH7VTTES2LHQC

Dependencies

  • [2] WPIUUBJI Use URIs instead of string paths in changelog
  • [3] 7A3NMQ6Q Show altered files instead of dependencies as children of changes in changelog
  • [*] ZGMIJNFV Create pijul.ts for executing commands using the Pijul CLI

Change contents

  • replacement in src/pijul.ts at line 311
    [3.1956][3.1956:2015]()
    const changePattern = /\d\.\s([A-Za-z]+)\sin\s(.*):/g;
    [3.1956]
    [2.1087]
    // Big complicated regex needs to match both the 'Edit in src/repository.ts' format
    // and the 'File addition: "yarn.lock" format.
    const changePattern = /\d\.\s(?:(?:([A-Za-z]+)\sin\s)(.*):|(.*):\s"(\S+)")/g;
  • replacement in src/pijul.ts at line 318
    [3.2126][2.1148:1189]()
    const [, operation, path] = match;
    [3.2126]
    [2.1189]
    // Since their are two formats the operation and path can be in, there are four
    // capture groups for two properties. These two statements take whichever is defined.
    const operation = match[1] ?? match[3];
    const path = match[2] ?? match[4];