mirror of
https://github.com/m1k1o/neko.git
synced 2024-07-24 14:40:50 +12:00
fix dev scripts.
This commit is contained in:
parent
f65f262d48
commit
ae117ccdbb
4
dev/fmt
4
dev/fmt
@ -2,8 +2,8 @@
|
|||||||
cd "$(dirname "$0")"
|
cd "$(dirname "$0")"
|
||||||
|
|
||||||
if [ "$(docker images -q neko_server_build 2> /dev/null)" == "" ]; then
|
if [ "$(docker images -q neko_server_build 2> /dev/null)" == "" ]; then
|
||||||
echo "Image 'neko_server_build' not found. Run ./build first."
|
echo "Image 'neko_server_build' not found. Run ./build first."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
docker run -it --rm \
|
docker run -it --rm \
|
||||||
|
4
dev/go
4
dev/go
@ -2,8 +2,8 @@
|
|||||||
cd "$(dirname "$0")"
|
cd "$(dirname "$0")"
|
||||||
|
|
||||||
if [ "$(docker images -q neko_server_build 2> /dev/null)" == "" ]; then
|
if [ "$(docker images -q neko_server_build 2> /dev/null)" == "" ]; then
|
||||||
echo "Image 'neko_server_build' not found. Run ./build first."
|
echo "Image 'neko_server_build' not found. Run ./build first."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
docker run -it \
|
docker run -it \
|
||||||
|
4
dev/lint
4
dev/lint
@ -2,8 +2,8 @@
|
|||||||
cd "$(dirname "$0")"
|
cd "$(dirname "$0")"
|
||||||
|
|
||||||
if [ "$(docker images -q neko_server_build 2> /dev/null)" == "" ]; then
|
if [ "$(docker images -q neko_server_build 2> /dev/null)" == "" ]; then
|
||||||
echo "Image 'neko_server_build' not found. Run ./build first."
|
echo "Image 'neko_server_build' not found. Run ./build first."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#
|
#
|
||||||
|
@ -2,8 +2,8 @@
|
|||||||
cd "$(dirname "$0")"
|
cd "$(dirname "$0")"
|
||||||
|
|
||||||
if [ -z "$(docker images -q neko_server_app 2> /dev/null)" ]; then
|
if [ -z "$(docker images -q neko_server_app 2> /dev/null)" ]; then
|
||||||
echo "Image 'neko_server_app' not found. Running ./build first."
|
echo "Image 'neko_server_app' not found. Running ./build first."
|
||||||
./build
|
./build
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -z $NEKO_PORT ]; then
|
if [ -z $NEKO_PORT ]; then
|
||||||
@ -22,6 +22,10 @@ if [ -z $NEKO_NAT1TO1 ]; then
|
|||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
if [ -z $NEKO_NAT1TO1 ]; then
|
||||||
|
NEKO_NAT1TO1=$(hostname -I 2>/dev/null | awk '{print $1}')
|
||||||
|
fi
|
||||||
|
|
||||||
if [ -z $NEKO_NAT1TO1 ]; then
|
if [ -z $NEKO_NAT1TO1 ]; then
|
||||||
NEKO_NAT1TO1=$(hostname -i 2>/dev/null)
|
NEKO_NAT1TO1=$(hostname -i 2>/dev/null)
|
||||||
fi
|
fi
|
||||||
|
@ -3,8 +3,14 @@ package utils
|
|||||||
import (
|
import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"reflect"
|
"reflect"
|
||||||
|
|
||||||
|
"github.com/mitchellh/mapstructure"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
func Decode(input interface{}, output interface{}) error {
|
||||||
|
return mapstructure.Decode(input, output)
|
||||||
|
}
|
||||||
|
|
||||||
func Unmarshal(in any, raw []byte, callback func() error) error {
|
func Unmarshal(in any, raw []byte, callback func() error) error {
|
||||||
if err := json.Unmarshal(raw, &in); err != nil {
|
if err := json.Unmarshal(raw, &in); err != nil {
|
||||||
return err
|
return err
|
Loading…
Reference in New Issue
Block a user