dorky 1.0.6 → 1.2.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.
- package/.github/workflows/publish.yml +27 -0
- package/README.md +23 -3
- package/dorky-usage.svg +1 -0
- package/index.js +32 -19
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -122,9 +122,9 @@ function pushChanges() {
|
|
|
122
122
|
} catch (err) {
|
|
123
123
|
console.log(
|
|
124
124
|
"Unable to upload file " +
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
125
|
+
path
|
|
126
|
+
.join(rootFolder, path.relative(process.cwd(), file))
|
|
127
|
+
.replace(/\\/g, "/")
|
|
128
128
|
);
|
|
129
129
|
console.log(err);
|
|
130
130
|
}
|
|
@@ -188,15 +188,15 @@ function pushChanges() {
|
|
|
188
188
|
} catch (err) {
|
|
189
189
|
console.log(
|
|
190
190
|
"Unable to upload file " +
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
)
|
|
191
|
+
path
|
|
192
|
+
.join(
|
|
193
|
+
rootFolder,
|
|
194
|
+
path.relative(
|
|
195
|
+
process.cwd(),
|
|
196
|
+
path.join(rootFolder.toString(), "metadata.json")
|
|
198
197
|
)
|
|
199
|
-
|
|
198
|
+
)
|
|
199
|
+
.replace(/\\/g, "/")
|
|
200
200
|
);
|
|
201
201
|
console.log(err);
|
|
202
202
|
}
|
|
@@ -228,9 +228,9 @@ function pushChanges() {
|
|
|
228
228
|
} catch (err) {
|
|
229
229
|
console.log(
|
|
230
230
|
"Unable to upload file " +
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
231
|
+
path
|
|
232
|
+
.join(rootFolder, path.relative(process.cwd(), file))
|
|
233
|
+
.replace(/\\/g, "/")
|
|
234
234
|
);
|
|
235
235
|
console.log(err);
|
|
236
236
|
}
|
|
@@ -259,13 +259,18 @@ function pushChanges() {
|
|
|
259
259
|
const uploadResponse = await s3Client.send(
|
|
260
260
|
new PutObjectCommand(putObjectParams)
|
|
261
261
|
);
|
|
262
|
-
if (uploadResponse)
|
|
262
|
+
if (uploadResponse)
|
|
263
|
+
console.log(
|
|
264
|
+
chalk.green(
|
|
265
|
+
"Uploaded " + path.join(rootFolder.toString(), "metadata.json")
|
|
266
|
+
)
|
|
267
|
+
);
|
|
263
268
|
} catch (err) {
|
|
264
269
|
console.log(
|
|
265
270
|
"Unable to upload file " +
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
271
|
+
path
|
|
272
|
+
.join(rootFolder, path.relative(process.cwd(), file))
|
|
273
|
+
.replace(/\\/g, "/")
|
|
269
274
|
);
|
|
270
275
|
console.log(err);
|
|
271
276
|
}
|
|
@@ -428,7 +433,7 @@ if (
|
|
|
428
433
|
} else {
|
|
429
434
|
console.log(
|
|
430
435
|
chalk.red(
|
|
431
|
-
"Unable to find .dorky folder, please reinitialize the project in the root folder."
|
|
436
|
+
"Unable to find .dorky folder, please reinitialize the project in the root folder or set the BUCKET_NAME, AWS_ACCESS_KEY, AWS_SECRET_KEY and AWS_REGION in environment variables."
|
|
432
437
|
)
|
|
433
438
|
);
|
|
434
439
|
exit();
|
|
@@ -438,6 +443,14 @@ if (
|
|
|
438
443
|
const args = process.argv.splice(2, 2);
|
|
439
444
|
|
|
440
445
|
if (args.length == 0) {
|
|
446
|
+
const figlet = `
|
|
447
|
+
__ __
|
|
448
|
+
.--| .-----.----| |--.--.--.
|
|
449
|
+
| _ | _ | _| <| | |
|
|
450
|
+
|_____|_____|__| |__|__|___ |
|
|
451
|
+
|_____|
|
|
452
|
+
`;
|
|
453
|
+
console.log(figlet);
|
|
441
454
|
const helpMessage = `Help message:\ninit\t Initializes a dorky project.\nlist\t Lists files in current root directory.\npush\t Pushes changes to S3 bucket.\npull\t Pulls changes from S3 bucket to local root folder.`;
|
|
442
455
|
console.log(helpMessage);
|
|
443
456
|
} else if (args.length == 1) {
|