aboutsummaryrefslogtreecommitdiffstats
path: root/node_modules/tar/dist/esm/create.js
diff options
context:
space:
mode:
authorpack <pack@packgekko.xyz>2026-08-09 10:54:08 +0000
committerpack <pack@packgekko.xyz>2026-08-09 10:54:08 +0000
commitd3adc16a08d95d6e331de55d7d3bf05a66a874a8 (patch)
treea2dabd199501e67c547c2ce79e1374ca3aa55443 /node_modules/tar/dist/esm/create.js
parent55a4f1fc869e41aca748c63d3018f0448b1606e0 (diff)
downloadcrud-d3adc16a08d95d6e331de55d7d3bf05a66a874a8.tar.gz
stop tracking node_modules/
Diffstat (limited to 'node_modules/tar/dist/esm/create.js')
-rw-r--r--node_modules/tar/dist/esm/create.js76
1 files changed, 0 insertions, 76 deletions
diff --git a/node_modules/tar/dist/esm/create.js b/node_modules/tar/dist/esm/create.js
deleted file mode 100644
index 4e88751..0000000
--- a/node_modules/tar/dist/esm/create.js
+++ /dev/null
@@ -1,76 +0,0 @@
-import { WriteStream, WriteStreamSync } from '@isaacs/fs-minipass';
-import path from 'node:path';
-import { list } from './list.js';
-import { makeCommand } from './make-command.js';
-import { Pack, PackSync } from './pack.js';
-const createFileSync = (opt, files) => {
- const p = new PackSync(opt);
- const stream = new WriteStreamSync(opt.file, {
- mode: opt.mode || 0o666,
- });
- p.pipe(stream);
- addFilesSync(p, files);
-};
-const createFile = (opt, files) => {
- const p = new Pack(opt);
- const stream = new WriteStream(opt.file, {
- mode: opt.mode || 0o666,
- });
- p.pipe(stream);
- const promise = new Promise((res, rej) => {
- stream.on('error', rej);
- stream.on('close', res);
- p.on('error', rej);
- });
- addFilesAsync(p, files).catch(er => p.emit('error', er));
- return promise;
-};
-const addFilesSync = (p, files) => {
- files.forEach(file => {
- if (file.charAt(0) === '@') {
- list({
- file: path.resolve(p.cwd, file.slice(1)),
- sync: true,
- noResume: true,
- onReadEntry: entry => p.add(entry),
- });
- }
- else {
- p.add(file);
- }
- });
- p.end();
-};
-const addFilesAsync = async (p, files) => {
- for (const file of files) {
- if (file.charAt(0) === '@') {
- await list({
- file: path.resolve(String(p.cwd), file.slice(1)),
- noResume: true,
- onReadEntry: entry => {
- p.add(entry);
- },
- });
- }
- else {
- p.add(file);
- }
- }
- p.end();
-};
-const createSync = (opt, files) => {
- const p = new PackSync(opt);
- addFilesSync(p, files);
- return p;
-};
-const createAsync = (opt, files) => {
- const p = new Pack(opt);
- addFilesAsync(p, files).catch(er => p.emit('error', er));
- return p;
-};
-export const create = makeCommand(createFileSync, createFile, createSync, createAsync, (_opt, files) => {
- if (!files?.length) {
- throw new TypeError('no paths specified to add to archive');
- }
-});
-//# sourceMappingURL=create.js.map \ No newline at end of file