Skip to content

Commit

Permalink
feat(cli): autostart without a console window
Browse files Browse the repository at this point in the history
This moves `komorebic` logic into a `lib.rs` file and calls it from `main.rs` (normal behavior) and then there is a second binary `komorebic-no-console` binary that uses `#![windows_subsystem = "windows"]` which tells the linker to not attach a console window to this binary.
  • Loading branch information
amrbashir committed Nov 25, 2023
1 parent a68f384 commit 08494b4
Show file tree
Hide file tree
Showing 5 changed files with 2,362 additions and 2,338 deletions.
9 changes: 9 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,15 @@ builds:
post:
- mkdir -p dist/windows_amd64
- cp ".\target\x86_64-pc-windows-msvc\release\komorebic.exe" ".\dist\komorebic_windows_amd64_v1\komorebic.exe"
- id: komorebic-no-console
main: dummy.go
goos: ["windows"]
goarch: ["amd64"]
binary: komorebic-no-console
hooks:
post:
- mkdir -p dist/windows_amd64
- cp ".\target\x86_64-pc-windows-msvc\release\komorebic-no-console.exe" ".\dist\komorebic_no_console_windows_amd64_v1\komorebic-no-console.exe"

archives:
- name_template: "{{ .ProjectName }}-{{ .Version }}-x86_64-pc-windows-msvc"
Expand Down
5 changes: 5 additions & 0 deletions komorebic/src/bin/komorebic-no-console.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#![windows_subsystem = "windows"]

fn main() -> color_eyre::Result<()> {
komorebic::main()
}
Loading

0 comments on commit 08494b4

Please sign in to comment.