fix: delete upload auth

This commit is contained in:
junchi.zhang
2026-03-06 16:56:40 +08:00
parent c6c629e9ae
commit 841b9f0f11
3 changed files with 16 additions and 9 deletions
+2 -1
View File
@@ -4,4 +4,5 @@ node_modules
.env
/test
/temp
/test-repro
/test-repro
.catpaw
+13 -7
View File
@@ -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
View File
@@ -1,6 +1,6 @@
{
"name": "pinme",
"version": "1.2.5",
"version": "1.2.6",
"publishConfig": {
"access": "public"
},