Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Before this PR, if you go ran a Service Weaver app with a config file that was missing an app name and a binary, the app name would erroneously default to ".". ``` ╭──────────────────────────────────────────────────╮ │ DEPLOYMENTS │ ├─────┬──────────────────────────────────────┬─────┤ │ APP │ DEPLOYMENT │ AGE │ ├─────┼──────────────────────────────────────┼─────┤ │ . │ 10695f3a-0afe-4361-8d9a-033fd6ea81a0 │ 2s │ ╰─────┴──────────────────────────────────────┴─────╯ ╭────────────────────────────────────────────────╮ │ COMPONENTS │ ├─────┬────────────┬──────────────┬──────────────┤ │ APP │ DEPLOYMENT │ COMPONENT │ REPLICA PIDS │ ├─────┼────────────┼──────────────┼──────────────┤ │ . │ 10695f3a │ weaver.Main │ 2417098 │ │ . │ 10695f3a │ collatz.Even │ 2417098 │ │ . │ 10695f3a │ collatz.Odd │ 2417098 │ │ . │ 10695f3a │ main │ 2417098 │ ╰─────┴────────────┴──────────────┴──────────────╯ ╭──────────────────────────────────────────────╮ │ LISTENERS │ ├─────┬────────────┬──────────┬────────────────┤ │ APP │ DEPLOYMENT │ LISTENER │ ADDRESS │ ├─────┼────────────┼──────────┼────────────────┤ │ . │ 10695f3a │ collatz │ 127.0.0.1:9000 │ ╰─────┴────────────┴──────────┴────────────────╯ ``` To calculate the app name, we called `filepath.Base` on the binary, but if the binary was empty, `filepath.Base` would return `"."`. This PR fixes the bug by only setting the app name if the binary is present.
- Loading branch information