Skip to content
Merged
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
2 changes: 1 addition & 1 deletion cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"test": "yarn link-fix && ava",
"lint": "eslint",
"lint-fix": "eslint --fix ./source/**/*",
"start": "node dist/cli.js"
"start": "[ -e ../.env ] && set -a && . ../.env; node dist/cli.js"
},
"files": [
"dist"
Expand Down
28 changes: 22 additions & 6 deletions cli/source/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,17 @@ const CliUi = () => {

const processRef = useRef<ChildProcessWithoutNullStreams | null>();

const frontend_port = process.env['PORT'];
const sync_server_port = process.env['SYNC_SERVER_PORT'];
const analytics_server_port = process.env['ANALYTICS_SERVER_PORT'];
const db_port = process.env['DB_PORT'];
const db_host = process.env['DB_HOST'];
const db_name = process.env['DB_NAME'];
const db_user = process.env['DB_USER'];
const db_pass = process.env['DB_PASS'];
const redis_port = process.env['REDIS_PORT'];
const redis_host = process.env['REDIS_HOST'];

const runCommandOpts = useMemo<Parameters<typeof runCommand>['2']>(
() => ({
onData: (line) =>
Expand Down Expand Up @@ -69,7 +80,10 @@ const CliUi = () => {
})
)
),
log_buffer: new CircularBuffer<string>(10)
log_buffer: new CircularBuffer<string>(10),
options: {
env: process.env
}
}),

[dispatch, lineLimit]
Expand Down Expand Up @@ -419,14 +433,16 @@ const CliUi = () => {
<Text bold underline color="#7e57c2">
Access Info
</Text>
<Text bold>http://localhost:3333</Text>
<Text bold>http://localhost:9696</Text>
<Text bold>http://localhost:6380</Text>
<Text bold>http://localhost:5434</Text>
<Text bold>{`http://localhost:${frontend_port}`}</Text>
<Text bold>{`http://localhost:${analytics_server_port}`}</Text>
<Text bold>{`redis://${redis_host}:${redis_port}/0`}</Text>
<Text
bold
>{`postgresql://${db_user}:${db_pass}@${db_host}:${db_port}/${db_name}`}</Text>
<Text bold color="grey">
--
</Text>
<Text bold>http://localhost:9697</Text>
<Text bold>{`http://localhost:${sync_server_port}`}</Text>
</Box>
)}
</Box>
Expand Down
6 changes: 3 additions & 3 deletions dev.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

docker-compose down

cat env.example > .env
[ ! -f .env ] && cp env.example .env

check_internet_connection() {
curl -s https://www.google.com > /dev/null 2>&1
Expand Down Expand Up @@ -41,10 +41,10 @@ update_or_add_env_var "BUILD_DATE" "$GIT_COMMIT_DATE"
update_or_add_env_var "MERGE_COMMIT_SHA" "$GIT_COMMIT_HASH"
update_or_add_env_var "BEHIND_COMMITS_COUNT" "$BEHIND_COMMITS_COUNT"


set -o allexport; source .env; set +o allexport
cd ./cli || exit

{ yarn && yarn build; } > /dev/null 2>&1
yarn start

cd ..
cd ..