type-git 0.6.0 → 0.8.0

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.
@@ -5,7 +5,7 @@
5
5
 
6
6
 
7
7
 
8
- var _chunkBRFWPLJ7cjs = require('./chunk-BRFWPLJ7.cjs');
8
+ var _chunkUHZWPYTFcjs = require('./chunk-UHZWPYTF.cjs');
9
9
 
10
10
  // src/adapters/node/exec.ts
11
11
  var _child_process = require('child_process');
@@ -134,7 +134,7 @@ var NodeExecAdapter = class {
134
134
  exitSignal = sig;
135
135
  }
136
136
  resolve({
137
- stdout: binary ? _chunkBRFWPLJ7cjs.joinBytes.call(void 0, stdoutChunks) : stdout,
137
+ stdout: binary ? _chunkUHZWPYTFcjs.joinBytes.call(void 0, stdoutChunks) : stdout,
138
138
  stderr,
139
139
  exitCode: _nullishCoalesce(code, () => ( -1)),
140
140
  signal: exitSignal,
@@ -273,7 +273,7 @@ var NodeFsAdapter = (_class = class {constructor() { _class.prototype.__init.cal
273
273
  sleep: (ms) => new Promise((resolve) => setTimeout(resolve, ms))
274
274
  };
275
275
  try {
276
- await _chunkBRFWPLJ7cjs.runTailPolling.call(void 0, { adapter, signal, pollInterval, onLine });
276
+ await _chunkUHZWPYTFcjs.runTailPolling.call(void 0, { adapter, signal, pollInterval, onLine });
277
277
  } finally {
278
278
  if (state.file) {
279
279
  await state.file.close();
@@ -292,6 +292,17 @@ var NodeFsAdapter = (_class = class {constructor() { _class.prototype.__init.cal
292
292
  async deleteDirectory(dirPath) {
293
293
  await _promises.rm.call(void 0, dirPath, { force: true, recursive: true });
294
294
  }
295
+ async readDirectory(dirPath) {
296
+ try {
297
+ return await _promises.readdir.call(void 0, dirPath);
298
+ } catch (error) {
299
+ const code = error.code;
300
+ if (code === "ENOENT" || code === "ENOTDIR") {
301
+ return [];
302
+ }
303
+ throw error;
304
+ }
305
+ }
295
306
  async exists(filePath) {
296
307
  try {
297
308
  await _promises.access.call(void 0, filePath);
@@ -330,7 +341,7 @@ var NodeFsAdapter = (_class = class {constructor() { _class.prototype.__init.cal
330
341
  },
331
342
  sleep: (ms) => new Promise((resolve) => setTimeout(resolve, ms))
332
343
  };
333
- const polling = _chunkBRFWPLJ7cjs.createTailPolling.call(void 0, { adapter, signal, pollInterval });
344
+ const polling = _chunkUHZWPYTFcjs.createTailPolling.call(void 0, { adapter, signal, pollInterval });
334
345
  const closeFileHandle = async () => {
335
346
  if (state.file) {
336
347
  await state.file.close().catch(() => {
@@ -368,18 +379,18 @@ function splitOptions(options) {
368
379
  adapters: createNodeAdapters(windowsHide === void 0 ? void 0 : { windowsHide })
369
380
  };
370
381
  }
371
- var TypeGit = class _TypeGit extends _chunkBRFWPLJ7cjs.GitClient {
382
+ var TypeGit = class _TypeGit extends _chunkUHZWPYTFcjs.GitClient {
372
383
  /**
373
384
  * Create a client after checking the installed Git version. Node adapter options such as
374
385
  * `windowsHide` are passed to the execution adapter.
375
386
  */
376
387
  static async create(options) {
377
- return new _TypeGit(await _chunkBRFWPLJ7cjs.createGit.call(void 0, splitOptions(options)));
388
+ return new _TypeGit(await _chunkUHZWPYTFcjs.createGit.call(void 0, splitOptions(options)));
378
389
  }
379
390
  /** Wrap an existing Git instance, or create one from options without the version check. */
380
391
  constructor(optionsOrGit) {
381
392
  super(
382
- optionsOrGit && "open" in optionsOrGit ? optionsOrGit : _chunkBRFWPLJ7cjs.createGitSync.call(void 0, splitOptions(optionsOrGit))
393
+ optionsOrGit && "open" in optionsOrGit ? optionsOrGit : _chunkUHZWPYTFcjs.createGitSync.call(void 0, splitOptions(optionsOrGit))
383
394
  );
384
395
  }
385
396
  };
@@ -5,7 +5,7 @@ import {
5
5
  createTailPolling,
6
6
  joinBytes,
7
7
  runTailPolling
8
- } from "./chunk-IYOGHATP.js";
8
+ } from "./chunk-ADC26634.js";
9
9
 
10
10
  // src/adapters/node/exec.ts
11
11
  import { spawn } from "child_process";
@@ -233,7 +233,7 @@ var NodeExecAdapter = class {
233
233
  };
234
234
 
235
235
  // src/adapters/node/fs.ts
236
- import { access, mkdtemp, open, readFile, rm, writeFile } from "fs/promises";
236
+ import { access, mkdtemp, open, readdir, readFile, rm, writeFile } from "fs/promises";
237
237
  import { tmpdir } from "os";
238
238
  import { join } from "path";
239
239
  var NodeFsAdapter = class {
@@ -292,6 +292,17 @@ var NodeFsAdapter = class {
292
292
  async deleteDirectory(dirPath) {
293
293
  await rm(dirPath, { force: true, recursive: true });
294
294
  }
295
+ async readDirectory(dirPath) {
296
+ try {
297
+ return await readdir(dirPath);
298
+ } catch (error) {
299
+ const code = error.code;
300
+ if (code === "ENOENT" || code === "ENOTDIR") {
301
+ return [];
302
+ }
303
+ throw error;
304
+ }
305
+ }
295
306
  async exists(filePath) {
296
307
  try {
297
308
  await access(filePath);