@@ -57,15 +57,25 @@ It allows you to download any folder or a file from a repo on github.
57
57
58
58
## Installation
59
59
60
- We support various installation options which you way want.
60
+ We support various installation options. Regardless of what you choose, if you want to make
61
+ CLIs written in JS run faster, I highly recommend adding this line to your ` .bashrc ` :
61
62
62
- ### Package with CLI and functions from [ default NPM registry] ( https://www.npmjs.com/package/fetch-github-folder )
63
+ ``` bash
64
+ export NODE_COMPILE_CACHE=~ /.cache/nodejs-compile-cache
65
+ ```
66
+
67
+ ### Install package with CLI and functions from [ default NPM registry] ( https://www.npmjs.com/package/fetch-github-folder )
63
68
64
69
``` bash
65
70
npm i fetch-github-folder
66
71
```
67
72
68
- ### Package with only functions from [ JSR] ( https://jsr.io/@nikelborm/fetch-github-folder )
73
+ <details >
74
+ <summary >
75
+
76
+ ### Install package with only functions from [ JSR] ( https://jsr.io/@nikelborm/fetch-github-folder )
77
+
78
+ </summary >
69
79
70
80
Unfortunately JSR doesn't support publishing executables yet, so you can install
71
81
only script library with functions that will allow you to fetch github folder
@@ -75,7 +85,13 @@ from other scripts.
75
85
npx jsr add @nikelborm/fetch-github-folder
76
86
```
77
87
78
- ### Package with CLI and functions from [ GitHub's NPM registry] ( https://github.com/nikelborm/fetch-github-folder/pkgs/npm/fetch-github-folder )
88
+ </details >
89
+ <details >
90
+ <summary >
91
+
92
+ ### Install package with CLI and functions from [ GitHub's NPM registry] ( https://github.com/nikelborm/fetch-github-folder/pkgs/npm/fetch-github-folder )
93
+
94
+ </summary >
79
95
80
96
1 . [ Generate ` Personal access token (classic) ` with ` read:packages ` scope] ( https://github.com/settings/tokens/new?description=Install%20packages%20from%20GitHub%20NPM%20registry&scopes=read:packages&default_expires_at=none )
81
97
2 . Login to Github's NPM registry (yes you need to do it, even if the package is public):
@@ -95,32 +111,52 @@ npx jsr add @nikelborm/fetch-github-folder
95
111
npm i @nikelborm/fetch-github-folder
96
112
` ` `
97
113
98
- # ## Package with CLI and functions from [Github Releases](https://github.com/nikelborm/fetch-github-folder/releases)
114
+ < /details>
115
+ < details>
116
+ < summary>
117
+
118
+ # ## Install package with CLI and functions from [Github Releases](https://github.com/nikelborm/fetch-github-folder/releases)
119
+
120
+ < /summary>
99
121
100
122
` ` ` bash
101
123
PACKAGE=fetch-github-folder
102
124
125
+ # Either set specific tag
103
126
TAG=0.1.27 && npm i https://github.com/nikelborm/$PACKAGE /releases/download/$TAG /$PACKAGE .tgz
104
- # or
127
+ # or download the latest
105
128
npm i https://github.com/nikelborm/$PACKAGE /releases/latest/download/$PACKAGE .tgz
106
129
` ` `
107
130
108
- # ## Only CLI directly into the system from [Github Releases](https://github.com/nikelborm/fetch-github-folder/releases)
131
+ < /details>
132
+ < details open>
133
+ < summary>
134
+
135
+ # ## Install only the CLI directly into the system from [Github Releases](https://github.com/nikelborm/fetch-github-folder/releases)
136
+
137
+ < /summary>
109
138
110
139
` ` ` bash
111
140
set -euo pipefail
112
141
PACKAGE=fetch-github-folder
113
142
114
143
path_to_the_script=/usr/bin/$PACKAGE
115
144
145
+ # Either set specific tag
116
146
TAG=0.1.27 && sudo curl -sLo $path_to_the_script https://github.com/nikelborm/$PACKAGE /releases/download/$TAG /$PACKAGE .js
117
- # or
147
+ # or download the latest
118
148
sudo curl -sLo $path_to_the_script https://github.com/nikelborm/$PACKAGE /releases/latest/download/$PACKAGE .js
119
149
120
150
sudo chmod +x $path_to_the_script
121
151
` ` `
122
152
123
- # ## Local development
153
+ < /details>
154
+ < details>
155
+ < summary>
156
+
157
+ # ## Setup the repo for local development
158
+
159
+ < /summary>
124
160
125
161
` ` ` bash
126
162
git clone -b main [email protected] :nikelborm/fetch-github-folder.git
@@ -131,12 +167,7 @@ read -sp 'Enter github access token: ' gh_token; echo;
131
167
sed -i " s/\(GITHUB_ACCESS_TOKEN\)='.*'/\1='$gh_token '/" .env
132
168
` ` `
133
169
134
- Also it' s recommended to add this string to your .bashrc, if you want faster
135
- CLIs written in JS
136
-
137
- ```bash
138
- export NODE_COMPILE_CACHE=~/.cache/nodejs-compile-cache
139
- ```
170
+ < /details>
140
171
141
172
# # Usage
142
173
@@ -160,7 +191,7 @@ import {
160
191
161
192
# ## Execution of CLI installed with NPM
162
193
163
- The easiest way to execute the CLI (preliminary installation is not required) is
194
+ The ** easiest way** to execute the CLI (preliminary installation is not required) is
164
195
like this:
165
196
166
197
` ` ` bash
@@ -173,8 +204,13 @@ Also there's a shorter form available (preliminary installation is required):
173
204
npx fgf --repoOwner apache --repoName superset
174
205
```
175
206
207
+ <details>
208
+ <summary>
209
+
176
210
### Non-interactive CLI execution on the fly from [Github Releases](https://github.com/nikelborm/fetch-github-folder/releases)
177
211
212
+ </summary>
213
+
178
214
If you already know the supported arguments (e.g. `--help` to print them all),
179
215
you can pipe the bundled and minified script version into node directly and pass
180
216
your arguments after `node -`:
@@ -187,8 +223,14 @@ TAG=0.1.27 && curl -sL https://github.com/nikelborm/$PACKAGE/releases/download/$
187
223
curl -sL https://github.com/nikelborm/$PACKAGE/releases/latest/download/$PACKAGE.js | node - --repoOwner apache --repoName superset
188
224
```
189
225
226
+ </details>
227
+ <details>
228
+ <summary>
229
+
190
230
### Interactive CLI execution from [Github Releases](https://github.com/nikelborm/fetch-github-folder/releases)
191
231
232
+ </summary>
233
+
192
234
The script also supports interactive mode (`--wizard`), where you will be asked
193
235
to pass arguments sequentially and interactively. Since it requires user input,
194
236
it can' t be piped and needs to be saved to a temporary file:
@@ -205,12 +247,20 @@ node $tmp_js --wizard
205
247
rm $tmp_js
206
248
` ` `
207
249
250
+ < /details>
251
+ < details open>
252
+ < summary>
253
+
208
254
# ## Execution of CLI installed directly into the system
209
255
256
+ < /summary>
257
+
210
258
` ` ` bash
211
259
fetch-github-folder --repoOwner apache --repoName superset
212
260
` ` `
213
261
262
+ < /details>
263
+
214
264
# # Environment Variables
215
265
216
266
If you often use the CLI, you can permanently set the arguments via env
0 commit comments