Skip to content

Commit

Permalink
Cleaning up
Browse files Browse the repository at this point in the history
  • Loading branch information
ineiti committed Sep 29, 2023
1 parent 636d9aa commit f2ac57a
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 12 deletions.
2 changes: 0 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -48,5 +48,3 @@ require (
google.golang.org/protobuf v1.31.0 // indirect
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c // indirect
)

//replace github.com/c4dt/dela-apps => ../dela-apps
4 changes: 2 additions & 2 deletions scripts/local_forms.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ echo "Form with ID $FORMID has been set up"

echo "Adding $SCIPER_ADMIN to voters"
tmpfile=$(mktemp)
echo -n "$SCIPER_ADMIN" > "$tmpfile"
(cd web/backend && npx ts-node src/cli.ts addVoters --election-id $FORMID --scipers-file "$tmpfile" )
echo -n "$SCIPER_ADMIN" >"$tmpfile"
(cd web/backend && npx ts-node src/cli.ts addVoters --election-id $FORMID --scipers-file "$tmpfile")
echo "Restarting backend to take into account voters"
"$SCRIPT_DIR/run_local.sh" backend
. "$SCRIPT_DIR/local_login.sh"
Expand Down
2 changes: 1 addition & 1 deletion scripts/local_login.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
SCRIPT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd)
. "$SCRIPT_DIR/local_vars.sh"

if ! [[ -f cookies.txt ]]; then
Expand Down
4 changes: 2 additions & 2 deletions scripts/local_proxies.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#!/bin/bash

SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
SCRIPT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd)
. "$SCRIPT_DIR/local_login.sh"

echo "adding proxies";
echo "adding proxies"

for node in $( seq 0 3 ); do
NodeAddr="localhost:$(( 2000 + node * 2))"
Expand Down
8 changes: 3 additions & 5 deletions scripts/run_local.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ if [[ $(git rev-parse --show-toplevel) != $(pwd) ]]; then
exit 1
fi

SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
SCRIPT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd)
. "$SCRIPT_DIR/local_vars.sh"

asdf_shell() {
Expand All @@ -26,13 +26,10 @@ mkdir -p nodes

function build_dela() {
echo "Building dela-node"
if ! [[ -d dela/ ]]; then
git clone https://github.com/c4dt/dela.git
fi
export GOBIN=$(pwd)/bin
PATH="$PATH":"$GOBIN"
if ! [[ -f $GOBIN/crypto ]]; then
(cd dela/cli/crypto && go install)
go install github.com/c4dt/dela/cli/crypto
fi
if ! [[ -f $GOBIN/dvoting ]]; then
go install ./cli/dvoting
Expand Down Expand Up @@ -60,6 +57,7 @@ function keypair() {

function kill_nodes() {
pkill dvoting || true
sleep 1
rm -rf nodes/node*
}

Expand Down

0 comments on commit f2ac57a

Please sign in to comment.