Skip to content

Commit

Permalink
Fix/defer close pid (#16)
Browse files Browse the repository at this point in the history
* fix: ensure rod launched chromium instance is killed on every run

* fix: error msg notes

* fix: bump codeQL

* fix: update Licence

+semver: feat
+semver: feature

bumping minor
  • Loading branch information
dnitsch authored Feb 24, 2024
1 parent 81b8ef0 commit ac79bd2
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 10 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
Expand All @@ -53,7 +53,7 @@ jobs:
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v1
uses: github/codeql-action/autobuild@v2

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
Expand All @@ -67,4 +67,4 @@ jobs:
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
uses: github/codeql-action/analyze@v2
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2022 dnitsch
Copyright (c) 2024 dnitsch

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ LDFLAGS := -ldflags="-s -w -X \"github.com/$(OWNER)/$(NAME)/cmd.Version=$(VERSIO
.PHONY: test test_ci tidy install buildprep build buildmac buildwin

test: test_prereq
go test ./... -v -mod=readonly -coverprofile=.coverage/out && \
go test ./... -v -mod=readonly -coverprofile=.coverage/out -race && \
cat .coverage/out | go-junit-report > .coverage/report-junit.xml && \
gocov convert .coverage/out | gocov-xml > .coverage/report-cobertura.xml

Expand Down
4 changes: 0 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,6 @@ By default the tool creates the session name - which can be audited including th

- Prior to `v0.8.0` you might be need to manually kill the `aws-cli-auth` process manually from your OS's process manager.

## Licence

WFTPL

## Contribute

Contributions to the aws-auth-cli package are most welcome from engineers of all backgrounds and skill levels.
Expand Down
12 changes: 11 additions & 1 deletion internal/web/web.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,17 @@ func (web *Web) GetSSOCredentials(conf credentialexchange.CredentialConfig) (str
func (web *Web) MustClose() {
err := web.browser.Close()
if err != nil {
fmt.Fprintf(os.Stderr, "%s", err)
fmt.Fprintf(os.Stderr, "failed to close browser instance: %s", err)
}
pid := web.launcher.PID()
proc, err := os.FindProcess(pid)
if err != nil {
fmt.Fprintf(os.Stderr, "failed to find launcher process(%d): %s", pid, err)
}
if proc != nil {
if err := proc.Kill(); err != nil {
fmt.Fprintf(os.Stderr, "failed to kill launcher process(%d): %s", pid, err)
}
}
}

Expand Down

0 comments on commit ac79bd2

Please sign in to comment.