Upgrade to Pro — share decks privately, control downloads, hide ads and more …

自作 CLI ツールのワークフローとそれを支える技術 / the workflow of my CLI tool and technologies which supports it

ktr
May 29, 2018

自作 CLI ツールのワークフローとそれを支える技術 / the workflow of my CLI tool and technologies which supports it

ktr

May 29, 2018
Tweet

More Decks by ktr

Other Decks in Technology

Transcript

  1. "45΁ม׵͠ɺόʔδϣϯΛ୳͢ ͜ͱͰɺ҆શʹॻ͖׵͕͑Մೳ LUSHPTFNWFS *ast.CallExpr { . Fun: *ast.SelectorExpr { .

    . X: *ast.Ident { . . . NamePos: meta.go:10:12 . . . Name: "semver" . . } . . Sel: *ast.Ident { . . . NamePos: meta.go:10:19 . . . Name: "MustParse" . . } . } . Lparen: meta.go:10:28 . Args: []ast.Expr (len = 1) { . . 0: *ast.BasicLit { . . . ValuePos: meta.go:10:29 . . . Kind: STRING . . . Value: "\"0.3.1\"" . . } . } . Ellipsis: - . Rparen: meta.go:10:36 }
  2. ෳ਺ϓϥοτϑΥʔϜ޲͚ʹϏϧυ (JU)VC3FMFBTFT΁ͷ഑෍ NJUDIFMMIHPY
 UDOLTNHIS mitchellh/gox gox -osarch "$OSARCH" . for

    f in *; do mv "$f" evans tar cvzf "$f.tar.gz" evans rm -f evans done tcnksm/ghr git tag "$VERSION" git push origin "$VERSION" ghr "$VERSION" pkg
  3. var current = semver.MustParse("0.2.0") func main() { means, _ :=

    updater.NewMeans( github.GitHubReleaseMeans("ktr0731", "evans", nil), ) u := updater.New(current, means) updatable, new, _ := u.Updatable(context.Background()) if updatable { _ = u.Update(context.Background()) fmt.Printf("updated: %s ! %s\n", current, new) } }
  4. var current = semver.MustParse("0.2.0") func main() { means, _ :=

    updater.SelectAvailableMeansFrom( context.Background(), brew.HomebrewMeans("ktr0731/evans", "evans"), github.GitHubReleaseMeans("ktr0731", "evans", nil), ) u := updater.New(current, means) updatable, new, _ := u.Updatable(context.Background()) if updatable { _ = u.Update(context.Background()) fmt.Printf("updated: %s ! %s\n", current, new) } }