Skip to content

Commit

Permalink
Fixed loading env for global installation.
Browse files Browse the repository at this point in the history
  • Loading branch information
pgebert committed Aug 22, 2023
1 parent 23461ed commit faba97c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,10 @@ npm run start

# test
npm run test

# install global
npm run build
npm install -g projektron-bcs-cli .
```

## Show your support
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "projektron-bcs-cli",
"version": "0.0.5",
"version": "0.0.6",
"description": "CLI for the Projektron BCS software.",
"author": "Patrick Gebert",
"license": "Apache 2.0",
Expand Down
7 changes: 4 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@ import {config as dotenvConfig} from 'dotenv';
import {handleCommand} from "./commands/commandHandler";
import {BcsClient, ForbiddenError, PageNotFoundError} from "./bcsClient";
import {setEnvValue} from "./utils/envUtils";
import * as path from "path";

const colors = require('ansi-colors');
const {prompt} = require('enquirer');
dotenvConfig();

dotenvConfig({path: path.resolve(__dirname, '../.env')});


colors.theme({
Expand Down Expand Up @@ -58,8 +60,7 @@ const main = async () => {
let baseUrl = process.env.BCS_URL || 'https://bcs.de'
let username = process.env.BCS_USERNAME || ''
let password = process.env.BCS_PASSWORD || ''



const bcsClient = await BcsClient.getInstance();

while (!bcsClient.isConnected) {
Expand Down

0 comments on commit faba97c

Please sign in to comment.