Skip to content

Commit

Permalink
Merge pull request #2 from codaqui/feat/improve-and-create
Browse files Browse the repository at this point in the history
feat(script): ✨ run of any dir
  • Loading branch information
endersonmenezes authored Oct 30, 2023
2 parents 3f13d19 + bf445d4 commit 08f7d6b
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions main.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
## Setup
set -euo pipefail

## Setup Variable
DIR_OF_THAT_FILE="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"

## Functions
function log(){
echo "[$(date +'%Y-%m-%dT%H:%M:%S%z')]: $1"
Expand Down Expand Up @@ -116,17 +119,17 @@ if ! type pbcopy > /dev/null 2>&1; then
fi

# Check if config.yaml exists
if [ ! -e config.yaml ]; then
if [ ! -e $DIR_OF_THAT_FILE/config.yaml ]; then
setup
fi

# Begin
VERSION=$(cat version)
VERSION=$(cat $DIR_OF_THAT_FILE/version)
log "Starting a Secret Sharing for Piping Server v$VERSION"

# Read config.yaml
log "Reading config.yaml"
piping_server_url=$(yq '.piping_server_url' config.yaml)
piping_server_url=$(yq '.piping_server_url' $DIR_OF_THAT_FILE/config.yaml)
log_success "piping_server_url: $piping_server_url"

# Test if the server is a piping server
Expand Down

0 comments on commit 08f7d6b

Please sign in to comment.