From ebfff70af5d62a8b6e7c50ba47af1163927aab99 Mon Sep 17 00:00:00 2001 From: reugn Date: Tue, 24 Aug 2021 20:37:34 +0300 Subject: [PATCH 1/4] update go version --- .github/workflows/release.yml | 4 ++-- .github/workflows/test.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 63f1b76..6898b38 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -3,7 +3,7 @@ name: Release on: push: tags: - - '*' + - 'v*' jobs: goreleaser: @@ -17,7 +17,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v2 with: - go-version: 1.15.x + go-version: 1.16.x - name: Run GoReleaser uses: goreleaser/goreleaser-action@v2 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index cfd9c63..7e96d37 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -7,7 +7,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - go-version: [1.14.x, 1.15.x] + go-version: [1.15.x, 1.16.x] steps: - name: Setup Go uses: actions/setup-go@v2 From 59ee2c2d45529b0f18f10abf7cd9f1efd70c5add Mon Sep 17 00:00:00 2001 From: reugn Date: Tue, 24 Aug 2021 20:50:17 +0300 Subject: [PATCH 2/4] customize goreleaser --- .github/.goreleaser.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 .github/.goreleaser.yml diff --git a/.github/.goreleaser.yml b/.github/.goreleaser.yml new file mode 100644 index 0000000..a8d9cf2 --- /dev/null +++ b/.github/.goreleaser.yml @@ -0,0 +1,17 @@ +project_name: wifiqr +builds: + - env: [CGO_ENABLED=0] + goos: + - linux + - windows + - darwin + goarch: + - amd64 + - arm64 +archives: + - replacements: + darwin: macos + amd64: x86_64 + format_overrides: + - goos: windows + format: zip \ No newline at end of file From 45bc8307c6757c79cb0b673a1e5e5e2f3d379b27 Mon Sep 17 00:00:00 2001 From: reugn Date: Tue, 24 Aug 2021 20:51:50 +0300 Subject: [PATCH 3/4] make hidden SSID parameter boolean --- cmd/wifiqr/main.go | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/cmd/wifiqr/main.go b/cmd/wifiqr/main.go index e9be1cd..66b378e 100644 --- a/cmd/wifiqr/main.go +++ b/cmd/wifiqr/main.go @@ -5,12 +5,11 @@ import ( "fmt" "os" "path/filepath" - "strconv" "github.com/reugn/wifiqr" ) -const version = "0.1.0" +const version = "0.2.0" var ( versionParam = flag.Bool("version", false, "Show version.") @@ -18,7 +17,7 @@ var ( ssidParam = flag.String("ssid", "", "The name of the wireless network. You'll be prompted to enter the SSID if not set.") keyParam = flag.String("key", "", "A pre-shared key (PSK). You'll be prompted to enter the key if not set.") encParam = flag.String("enc", "WPA2", "The wireless network encryption protocol (WEP, WPA, WPA2).") - hiddenParam = flag.String("hidden", "false", "Hidden SSID true/false.") + hiddenParam = flag.Bool("hidden", false, "Hidden SSID.") fileNameParam = flag.String("file", "", "A png file to write the QR Code (prints to stdout if not set).") sizeParam = flag.Int("size", 256, "Size is both the image width and height in pixels.") @@ -34,7 +33,7 @@ func main() { validateArguments() - config := wifiqr.NewConfig(*ssidParam, *keyParam, *encParam, validateAndGetHidden()) + config := wifiqr.NewConfig(*ssidParam, *keyParam, *encParam, *hiddenParam) q, err := wifiqr.InitCode(config) if err != nil { fmt.Println(err) @@ -62,15 +61,6 @@ func validateAndGetFileName() string { return *fileNameParam } -func validateAndGetHidden() bool { - hidden, err := strconv.ParseBool(*hiddenParam) - if err != nil { - fmt.Println(err) - os.Exit(1) - } - return hidden -} - func validateArguments() { if *ssidParam == "" { fmt.Println("Enter the name of the wireless network (SSID):") From 1d137b9bb5c51b5dcd1b2d061dc8095ab8bdb754 Mon Sep 17 00:00:00 2001 From: reugn Date: Wed, 25 Aug 2021 10:34:39 +0300 Subject: [PATCH 4/4] update the installation and usage instructions --- README.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index edf0f23..8a3909e 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,9 @@ Create a QR code with your Wi-Fi login details. Use Google Lens or other application to scan it and connect automatically. ## Installation +Pick a binary from the [releases](https://github.com/reugn/wifiqr/releases). + +### Build from source Download and install Go https://golang.org/doc/install. Clone the repository: @@ -30,8 +33,8 @@ Usage of ./wifiqr: The wireless network encryption protocol (WEP, WPA, WPA2). (default "WPA2") -file string A png file to write the QR Code (prints to stdout if not set). - -hidden string - Hidden SSID true/false. (default "false") + -hidden + Hidden SSID. -key string A pre-shared key (PSK). You'll be prompted to enter the key if not set. -size int