@datatruck/cli 0.11.5 → 0.11.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -184,7 +184,7 @@ class ResticRepository extends RepositoryAbstract_1.RepositoryAbstract {
184
184
  step: "Writing excluded paths list...",
185
185
  });
186
186
  const tmpDir = await (0, fs_util_1.mkTmpDir)("restic-exclude");
187
- const ignoredContents = (0, fs_util_1.fastglobToGitIgnore)(exclude).join("\n");
187
+ const ignoredContents = (0, fs_util_1.fastglobToGitIgnore)(exclude, sourcePath).join("\n");
188
188
  gitignorePath = (0, path_1.join)(tmpDir, "ignored.txt");
189
189
  await (0, promises_1.writeFile)(gitignorePath, ignoredContents);
190
190
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@datatruck/cli",
3
- "version": "0.11.5",
3
+ "version": "0.11.6",
4
4
  "dependencies": {
5
5
  "ajv": "^8.11.0",
6
6
  "async": "^3.2.4",
package/util/fs-util.d.ts CHANGED
@@ -32,7 +32,7 @@ export declare function forEachFile(dirPath: string, cb: (path: string, dir: boo
32
32
  /**
33
33
  * @experimental
34
34
  */
35
- export declare function fastglobToGitIgnore(patterns: string[]): string[];
35
+ export declare function fastglobToGitIgnore(patterns: string[], baseDir: string): string[];
36
36
  export declare function writeGitIgnoreList(options: {
37
37
  paths: NodeJS.ReadableStream | string[];
38
38
  }): Promise<string>;
package/util/fs-util.js CHANGED
@@ -216,10 +216,10 @@ exports.forEachFile = forEachFile;
216
216
  /**
217
217
  * @experimental
218
218
  */
219
- function fastglobToGitIgnore(patterns) {
219
+ function fastglobToGitIgnore(patterns, baseDir) {
220
220
  // https://github.com/mrmlnc/fast-glob#readme
221
221
  // https://git-scm.com/docs/gitignore
222
- return patterns.map((p) => (p.startsWith("/") ? p : `/${p}`));
222
+ return patterns.map((p) => `${baseDir}/${p}`);
223
223
  }
224
224
  exports.fastglobToGitIgnore = fastglobToGitIgnore;
225
225
  async function writeGitIgnoreList(options) {