diff --git a/.github/workflows/develop.yml b/.github/workflows/develop.yml index e4b335d..33bcf23 100644 --- a/.github/workflows/develop.yml +++ b/.github/workflows/develop.yml @@ -13,6 +13,6 @@ jobs: with: go-version: '1.22' - name: Make - run: ./cmd/develop.sh + run: cmd/develop.sh - name: Test run: go test -v -p 1 ./... diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a61f514..5ddca18 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -13,7 +13,7 @@ jobs: with: go-version: '1.22' - name: Make - run: ./cmd/release.sh + run: cmd/release.sh - name: Push uses: softprops/action-gh-release@v2 with: diff --git a/README.md b/README.md index b068d70..419272a 100644 --- a/README.md +++ b/README.md @@ -11,9 +11,9 @@ $ git clone https://github.com/mohanson/daze $ cd daze # On Linux or macOS -$ ./cmd/develop.sh +$ cmd/develop.sh # On Windows -$ ./cmd/develop.ps1 +$ cmd/develop.ps1 ``` The build results will be saved in the bin directory. You can keep this directory, and all other files are not required. @@ -146,7 +146,7 @@ Proxy control is a rule that determines whether network requests (TCP and UDP) g ## File rule.ls -Daze uses a "rule.ls" file to customize your own rules(optional). "rule.ls" has the highest priority in routers so you should carefully maintain it. The "rule.ls" is located on the "./rule.ls" by default, or you can use `daze client -r path/to/rule.ls` to apply it. +Daze uses a "rule.ls" file to customize your own rules(optional). "rule.ls" has the highest priority in routers so you should carefully maintain it. The "rule.ls" is located on the "rule.ls" by default, or you can use `daze client -r path/to/rule.ls` to apply it. ```text L a.com @@ -162,7 +162,7 @@ Glob is supported, such as `R *.google.com`. ## File rule.cidr -Daze also uses a CIDR(Classless Inter-Domain Routing) file to route addresses. The CIDR file is located at "./rule.cidr", and has a lower priority than "rule.ls". +Daze also uses a CIDR(Classless Inter-Domain Routing) file to route addresses. The CIDR file is located at "rule.cidr", and has a lower priority than "rule.ls". By default, daze has configured rule.cidr for China's mainland. You can update it manually via `daze gen cn`, this will pull the latest data from [http://ftp.apnic.net/apnic/stats/apnic/delegated-apnic-latest](http://ftp.apnic.net/apnic/stats/apnic/delegated-apnic-latest). diff --git a/cmd/develop.ps1 b/cmd/develop.ps1 index 63742ea..5f982d3 100644 --- a/cmd/develop.ps1 +++ b/cmd/develop.ps1 @@ -1,13 +1,13 @@ -if (!(Test-Path ./bin)) { - New-Item -Path ./bin -ItemType Directory | Out-Null +if (!(Test-Path bin)) { + New-Item -Path bin -ItemType Directory | Out-Null } -if (!(Test-Path ./bin/rule.cidr)) { - Copy-Item ./res/rule.cidr -Destination ./bin/rule.cidr +if (!(Test-Path bin/rule.cidr)) { + Copy-Item res/rule.cidr -Destination bin/rule.cidr } -if (!(Test-Path ./bin/rule.ls)) { - Copy-Item ./res/rule.ls -Destination ./bin/rule.ls +if (!(Test-Path bin/rule.ls)) { + Copy-Item res/rule.ls -Destination bin/rule.ls } & go build -o bin github.com/mohanson/daze/cmd/daze diff --git a/cmd/develop.sh b/cmd/develop.sh index 78c76d1..72a43a7 100755 --- a/cmd/develop.sh +++ b/cmd/develop.sh @@ -1,15 +1,15 @@ set -ex -if [ ! -d ./bin ]; then +if [ ! -d bin ]; then mkdir bin fi -if [ ! -f ./bin/rule.cidr ]; then - cp ./res/rule.cidr ./bin/rule.cidr +if [ ! -f bin/rule.cidr ]; then + cp res/rule.cidr bin/rule.cidr fi -if [ ! -f ./bin/rule.ls ]; then - cp ./res/rule.ls ./bin/rule.ls +if [ ! -f bin/rule.ls ]; then + cp res/rule.ls bin/rule.ls fi go build -o bin github.com/mohanson/daze/cmd/daze diff --git a/cmd/release.sh b/cmd/release.sh index 1b959f6..2007bbb 100755 --- a/cmd/release.sh +++ b/cmd/release.sh @@ -1,15 +1,15 @@ set -ex -rm -rf ./bin/release -mkdir -p ./bin/release +rm -rf bin/release +mkdir -p bin/release make() { - mkdir ./bin/release/daze_$1_$2 - cp ./README.md ./bin/release/daze_$1_$2/README.md - cp ./res/rule.cidr ./bin/release/daze_$1_$2/rule.cidr - cp ./res/rule.ls ./bin/release/daze_$1_$2/rule.ls - GOOS=$1 GOARCH=$2 go build -o ./bin/release/daze_$1_$2 github.com/mohanson/daze/cmd/daze - python -m zipfile -c ./bin/release/daze_$1_$2.zip ./bin/release/daze_$1_$2 + mkdir bin/release/daze_$1_$2 + cp README.md bin/release/daze_$1_$2/README.md + cp res/rule.cidr bin/release/daze_$1_$2/rule.cidr + cp res/rule.ls bin/release/daze_$1_$2/rule.ls + GOOS=$1 GOARCH=$2 go build -o bin/release/daze_$1_$2 github.com/mohanson/daze/cmd/daze + python -m zipfile -c bin/release/daze_$1_$2.zip bin/release/daze_$1_$2 } # https://golang.org/doc/install/source#environment