electron-builder-notarize icon indicating copy to clipboard operation
electron-builder-notarize copied to clipboard

is this possible to support .env as environment?

Open arvinxx opened this issue 2 years ago • 5 comments

I want to add appid and appidpwd to my private repo by .env file.

# .env
[email protected]
APPLE_ID_PASSWORD=xxxx-xxxx-xxxx-xxxx

So it can be shared between my devices.

But it seems that it don't recognize .env file.

Is it possible to support .env file as environment?

arvinxx avatar Jan 31 '22 18:01 arvinxx

Yeah I can add a simple require('dotenv').config() at the top of the script. I probably won't have time to do this until the weekend. If you feel like opening a PR go for it 😄

karaggeorge avatar Jan 31 '22 18:01 karaggeorge

@karaggeorge I open the pr #15 ,please check it~

arvinxx avatar Jan 31 '22 19:01 arvinxx

@arvinxx You can use env-cmd --file ./.env [command] simply as starter I use

env-cmd --file ./.env node ./package/builder.js

builder.js

const builder = require('electron-builder');
(async () => {
    try {
        await builder.build({config});
    } catch (exc) {
        console.error(exc);
        process.exit(1);
    }
})();

or .env-cmdrc

{
  "myconfig": {
    "APPLE_ID": "***",
    "APPLE_ID_PASSWORD": "***",
    "CSC_NAME": "*** OOO (***)",
    "TEAM_SHORT_NAME": "***"
  }
}

with

env-cmd --environments myconfig

You even can mix this

env-cmd --file ./.env env-cmd --environments myconfig

Delagen avatar Mar 29 '22 13:03 Delagen

Now its implemented on version 1.5.0

andirsun avatar Jun 03 '22 18:06 andirsun

~~I haven't gotten this working even in 1.5.0.~~

Oops. Don't export APPLE_ID=XXXX like you would to source the .env - Just APPLE_ID=XXXX.

Nantris avatar Jun 08 '22 23:06 Nantris