aboutsummaryrefslogtreecommitdiffgithub
diff options
context:
space:
mode:
authorAustin Adams <git@austinjadams.com>2016-04-18 19:52:03 -0400
committerAustin Adams <git@austinjadams.com>2016-04-18 19:52:03 -0400
commit21e7d9b1782cdae5e26c59d9b120f6439e913c8b (patch)
tree962e85232620439f2461ce24bf883eaec4320e11
parentfc272b6f69e55977aa5dd6ba20cdb9bce77cb677 (diff)
downloadtoolbag-21e7d9b1782cdae5e26c59d9b120f6439e913c8b.tar.gz
toolbag-21e7d9b1782cdae5e26c59d9b120f6439e913c8b.tar.xz
figlet: add missing err != nil check
Before, the figlet tool did not validate arguments! This could lead to some strange behavior. For instance, if you ran toolbag ... -figlet:template totally/fake/path ... you'd get figlet: dial: unknown network instead of an error message about the bogus template. Why? Because the figlet tool's argument-parsing method returned an error before reaching the code that intitalized the dialing information. Then, the initialization method ignored the error returned by the argument-parsing method, stumbling blindly ahead to Dial()ing the socket. This change fixes the typo that caused the latter.
-rw-r--r--tools/figlet.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/tools/figlet.go b/tools/figlet.go
index 52d8fd8..4616e7e 100644
--- a/tools/figlet.go
+++ b/tools/figlet.go
@@ -131,6 +131,9 @@ func (f *Figlet) findFonts(client *execd.Client) error {
func (f *Figlet) Init() error {
err := f.parseArgs()
+ if err != nil {
+ return err
+ }
client, err := f.makeClient()
if err != nil {