mirror of
https://github.com/glitternetwork/pinme.git
synced 2026-08-30 17:58:49 +08:00
fix: delete upload auth
This commit is contained in:
+2
-1
@@ -4,4 +4,5 @@ node_modules
|
||||
.env
|
||||
/test
|
||||
/temp
|
||||
/test-repro
|
||||
/test-repro
|
||||
.catpaw
|
||||
+13
-7
@@ -180,17 +180,23 @@ export default async (options?: UploadOptions): Promise<void> => {
|
||||
}),
|
||||
);
|
||||
|
||||
// Check auth
|
||||
const authConfig = getAuthConfig();
|
||||
if (!authConfig) {
|
||||
console.log(chalk.red('Please login first. Run: pinme set-appkey <AppKey>'));
|
||||
return;
|
||||
// Check if domain/dns options are provided
|
||||
const domainArg = getDomainFromArgs();
|
||||
const dnsArg = getDnsFromArgs();
|
||||
const needsAuth = !!domainArg || dnsArg;
|
||||
|
||||
// Check auth only when domain/dns options are provided
|
||||
let authConfig: { address: string; token: string } | null = null;
|
||||
if (needsAuth) {
|
||||
authConfig = getAuthConfig();
|
||||
if (!authConfig) {
|
||||
console.log(chalk.red('Please login first. Run: pinme set-appkey <AppKey>'));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// if the parameter is passed, upload directly, pinme upload /path/to/dir
|
||||
const argPath = process.argv[3];
|
||||
const domainArg = getDomainFromArgs();
|
||||
const dnsArg = getDnsFromArgs();
|
||||
|
||||
if (argPath && !argPath.startsWith('-')) {
|
||||
// use the synchronous path check function
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "pinme",
|
||||
"version": "1.2.5",
|
||||
"version": "1.2.6",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user