diff --git a/.gitignore b/.gitignore index 9184dae..9600ced 100644 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,5 @@ node_modules .env /test /temp -/test-repro \ No newline at end of file +/test-repro +.catpaw \ No newline at end of file diff --git a/bin/upload.ts b/bin/upload.ts index ca8e1f2..cebf281 100644 --- a/bin/upload.ts +++ b/bin/upload.ts @@ -180,17 +180,23 @@ export default async (options?: UploadOptions): Promise => { }), ); - // Check auth - const authConfig = getAuthConfig(); - if (!authConfig) { - console.log(chalk.red('Please login first. Run: pinme set-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 ')); + 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 diff --git a/package.json b/package.json index 55228bf..48c1c93 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "pinme", - "version": "1.2.5", + "version": "1.2.6", "publishConfig": { "access": "public" },