Created
July 28, 2021 17:17
-
-
Save isaacs/0a05e95b930cc3962fa727e3c02d7161 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
mkdir -p gh-274/folder1 | |
touch gh-274/folder1/main.js | |
touch gh-274/index.js | |
tree gh-274/ | |
node - <<JS | |
const tar = require('./') | |
tar.c({ | |
sync: true, | |
gzip: true, | |
file: 'gh-274.tar.gz', | |
cwd: 'gh-274', | |
}, require('fs').readdirSync('gh-274')) | |
JS | |
tar tvf gh-274.tar.gz | |
:<<OUTPUT | |
gh-274/ | |
├── folder1 | |
│ └── main.js | |
└── index.js | |
1 directory, 2 files | |
drwxr-xr-x 0 isaacs 20 0 Jul 28 10:15 folder1/ | |
-rw-r--r-- 0 isaacs 20 0 Jul 28 10:17 folder1/main.js | |
-rw-r--r-- 0 isaacs 20 0 Jul 28 10:17 index.js | |
OUTPUT |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment