diff --git a/README.md b/README.md index 89dbeb5..acf3986 100644 --- a/README.md +++ b/README.md @@ -40,13 +40,7 @@ publish-extension \ --edge-zip dist/chrome.zip ``` -> [!NOTE] -> -> `publish-extension` does not load any `.env` files, you're responsible for making sure the environment varaibles are set while running the command. In CI, this is easy, but to run the command locally, you'll need to use something like the `env-cmd` package: -> -> ```sh -> pnpm env-cmd -f .env.submit publish-extension ... -> ``` +`publish-extesion` will automatically look for a `.env.submit` file and load it if it exists. ## JS Usage @@ -112,8 +106,8 @@ publishExtension({ > Make sure to set the Firefox channel to "unlisted", chrome's publish target to "trustedTesters", and don't submit the extension for review for Chrome or Edge. This will prevent you from accidentally releasing one of the test extensions publically. 5. Run the dev commands to upload a test extension to the stores: ```sh - pnpm env-cmd -f .env.submit pnpm dev:all - pnpm env-cmd -f .env.submit pnpm dev:chrome - pnpm env-cmd -f .env.submit pnpm dev:firefox - pnpm env-cmd -f .env.submit pnpm dev:edge + pnpm dev:all + pnpm dev:chrome + pnpm dev:firefox + pnpm dev:edge ``` diff --git a/package.json b/package.json index 99dc751..19b78aa 100644 --- a/package.json +++ b/package.json @@ -67,7 +67,7 @@ "dev:firefox": "./scripts/dev.sh firefox", "dev:edge": "./scripts/dev.sh edge", "dev:help": "./scripts/dev.sh help", - "publish-extension": "env-cmd -f .env.submit tsx src/cli.ts", + "publish-extension": "tsx src/cli.ts", "prepack": "pnpm build", "prepare": "simple-git-hooks" }, @@ -98,7 +98,6 @@ "@types/prompts": "^2.4.4", "@vitest/coverage-v8": "^1.2.0", "archiver": "^5.3.1", - "env-cmd": "^10.1.0", "jsonwebtoken": "^8.5.1", "lint-staged": "^15.2.0", "npm-run-all": "^4.1.5", diff --git a/src/cli.ts b/src/cli.ts index 31107f9..770ef7a 100644 --- a/src/cli.ts +++ b/src/cli.ts @@ -4,6 +4,9 @@ import { submit } from './submit'; import { InlineConfig } from './config'; import { init } from './init'; import consola from 'consola'; +import { config } from 'dotenv'; + +config({ path: '.env.submit' }); const cli = cac('publish-extension'); cli.version(version);