Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get targets from AEMFED_TARGETS environment variable #32

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,13 @@ Run with specific server, ignore pattern (to ignore IntelliJ temp files) and fol
aemfed -t "http://admin:admin@localhost:4502" -w "ui.apps/src/main/content/jcr_root/"
```

Run with specific servers (from AEMFED_TARGETS environment variable);

```sh
export AEMFED_TARGETS="http://admin:mysecretpassword@localhost:4502,http://admin:mysecretpassword@localhost:4503"
aemfed -w "ui.apps/src/main/content/jcr_root/"
```

### Start with a `package.json` install

The following commands are for a `package.json` install. Since `aemfed` is only available for this project and not globally, we can not use the `aemfed` command directly. You can use `npx` to run modules only available for a specific project.
Expand Down
4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ function separate() {
// Command line options
const MSG_HELP = `Usage: aemfed [OPTIONS]
Options:
-t targets Default is http://admin:admin@localhost:4502
-t targets Default is from AEMFED_TARGETS evironment variable otherwise http://admin:admin@localhost:4502
-p proxy_port Default is 3000
-w path_to_watch Default is current
-e exclude_filter Anymatch exclude filter; disabled by default
Expand Down Expand Up @@ -94,7 +94,7 @@ export function init(): void {
}

// TODO make some sort of defaults file and get defaults from there (and use in all modules)
const targets: string = args.t || "http://admin:admin@localhost:4502";
const targets: string = args.t || process.env.AEMFED_TARGETS || "http://admin:admin@localhost:4502";
const proxyPort: number = parseInt(args.p, 10) || 3000;
const pushInterval: number = parseInt(args.i, 10) || 100;
const exclude: string = args.e || "";
Expand Down