use command arg instead of env vars
This commit is contained in:
parent
a582cf4d6d
commit
dd13d1157a
2 changed files with 8 additions and 7 deletions
|
@ -4,7 +4,8 @@ It downloads clyps!
|
|||
|
||||
## Usage
|
||||
|
||||
- Set `CLYP_TOKEN` to your Clyp `Authorization: Bearer` session token.
|
||||
- `node clyp-downloader.cjs`
|
||||
- Retrieve your Clyp access token from your browser. This should be under
|
||||
Developer Tools > Storage > Local Storage > `accessToken`.
|
||||
- `node clyp-downloader.cjs <accessToken>`
|
||||
- ???
|
||||
- Profit
|
||||
|
|
|
@ -8,13 +8,13 @@
|
|||
const process = require("process");
|
||||
const fs = require("fs");
|
||||
|
||||
const TOKEN = process.env["CLYP_TOKEN"];
|
||||
|
||||
if (!TOKEN) {
|
||||
console.error("No CLYP_TOKEN provided!");
|
||||
process.exit(1);
|
||||
if (process.argv.length != 3) {
|
||||
console.log("Usage: node clyp-downloader.cjs <CLYP_TOKEN>");
|
||||
process.exit(0);
|
||||
}
|
||||
|
||||
const TOKEN = process.argv[2];
|
||||
|
||||
class ClypUpload {
|
||||
/**
|
||||
* @param {string} name
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue