difftreelog
fix code review requests
in: master
5 files changed
.envrcdiffbeforeafterboth1#!/bin/sh23# Load .envrc from parent directories4source_up_if_exists5# Load .envrc-dev6source_env_if_exists .envrc-dev7# Common variables from .env8dotenv910RED='\033[0;31m'11GREEN='\033[0;32m'12RESET='\033[0m'1314dep_not_found=false15function check_bdk {16 if ! has $1; then17 echo -e "RED$1 not found (wanted for beadeker discovery)RESET"18 dep_not_found=true19 fi20}2122watch_file .baedeker/.bdk-env/discover.env23if test -f .baedeker/.bdk-env/discover.env; then24 check_bdk baedeker25 check_bdk docker26 check_bdk jq27 if $dep_not_found; then28 echo -e "REDNot performing bdk discoveryRESET"29 exit 030 fi3132 echo -e "GREENBaedeker env updatedRESET"33 nginx_id=docker-f--format=json|jq-s'flatten'|jq-r'.[] | select(.Service == "nginx") | .ID'-e34 if ! [ $? -eq 0 ]; then35 echo -e "REDNginx container not foundRESET"36 exit 037 fi38 nginx_ip=docker$nginx_id|jq-r-e'.[0].NetworkSettings.Networks[].IPAddress'39 if ! [ $? -eq 0 ]; then40 echo -e "REDNginx container network misconfigured?RESET"41 exit 042 fi43 tmpenv=mktemp44 cat .baedeker/.bdk-env/discover.env | sed "s|BALANCER_URL|$nginx_ip|g" > $tmpenv45 dotenv $tmpenv46 echo -e "GREENEnjoy your baedeker networks at echo$BDK_BALANCERsed"s|BALANCER_URL|$nginx_ip|g"RESET"47fi1#!/bin/sh23# Load .envrc from parent directories4source_up_if_exists5# Load .envrc-dev6source_env_if_exists .envrc-dev7# Common variables from .env8dotenv910RED='\033[0;31m'11GREEN='\033[0;32m'12RESET='\033[0m'1314dep_not_found=false15function check_bdk {16 if ! has $1; then17 echo -e "RED$1 not found (wanted for beadeker discovery)RESET"18 dep_not_found=true19 fi20}2122if ! diff .githooks/pre-commit .git/hooks/pre-commit >/dev/null; then23echo -e "REDHooks are updated, run make git-hooksRESET"24fi2526watch_file .baedeker/.bdk-env/discover.env27if test -f .baedeker/.bdk-env/discover.env; then28 check_bdk baedeker29 check_bdk docker30 check_bdk jq31 if $dep_not_found; then32 echo -e "REDNot performing bdk discoveryRESET"33 exit 034 fi3536 echo -e "GREENBaedeker env updatedRESET"37 nginx_id=docker-f--format=json|jq-s'flatten'|jq-r'.[] | select(.Service == "nginx") | .ID'-e38 if ! [ $? -eq 0 ]; then39 echo -e "REDNginx container not foundRESET"40 exit 041 fi42 nginx_ip=docker$nginx_id|jq-r-e'.[0].NetworkSettings.Networks[].IPAddress'43 if ! [ $? -eq 0 ]; then44 echo -e "REDNginx container network misconfigured?RESET"45 exit 046 fi47 tmpenv=mktemp48 cat .baedeker/.bdk-env/discover.env | sed "s|BALANCER_URL|$nginx_ip|g" > $tmpenv49 dotenv $tmpenv50 echo -e "GREENEnjoy your baedeker networks at echo$BDK_BALANCERsed"s|BALANCER_URL|$nginx_ip|g"RESET"51fi.githooks/pre-commitdiffbeforeafterboth--- a/.githooks/pre-commit
+++ b/.githooks/pre-commit
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
#
# Pre-push hook verifying that inappropriate code will not be pushed.
Makefilediffbeforeafterboth--- a/Makefile
+++ b/Makefile
@@ -167,3 +167,13 @@
.PHONY: clippy
clippy:
cargo clippy --features=quartz-runtime,unique-runtime,try-runtime,runtime-benchmarks --tests
+
+.PHONY: git-hooks
+git-hooks:
+ cp .githooks/pre-commit .git/hooks/pre-commit
+
+.PHONY: init
+init:
+ make git-hooks
+ cd tests
+ yarn install
README.mddiffbeforeafterboth--- a/README.md
+++ b/README.md
@@ -159,6 +159,11 @@
cd tests && yarn eslint --ext .ts,.js src/
```
+### Enable checking of code style on commits
+```bash
+make git-hooks
+```
+
## Karura token transfer
init.shdiffbeforeafterboth--- a/init.sh
+++ /dev/null
@@ -1 +0,0 @@
-git config --local core.hooksPath ./.githooks
\ No newline at end of file