2.0.1 • Published 6 years ago

@umm/git v2.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
6 years ago

git

  • git コマンドの Unity 実装

Requirement

  • Unity 2017.1
  • git
  • hub (Optional)

Install

$ npm install github:umm-projects/git

Usage

実装済のクラス

  • Git
    • git コマンドを同期的に実行
  • GitAsync
    • git コマンドを非同期的に実行
  • Hub
    • hub コマンドを同期的に実行
  • HubAsync
    • hub コマンドを非同期的に実行

実装済のサブコマンド

  • add
  • branch
  • checkout
  • commit
  • push
  • rev-parse
  • rm
  • pull-request
    • hub コマンドを利用

同期的にコマンドを実行する

Git.Add(new [] { "hoge.txt", "fuga.cs", });
Git.Commit("message for commit");
Git.Push("any_branch_name");

非同期的にコマンドを実行する

// 書き方を統一するために、空の Unit を吐き出すところから開始している
Observable.Return(Unit.Default)
    .SelectMany(_ => GitAsync.Add(new [] { "hoge.txt", "fuga.cs", }))
    .SelectMany(_ => GitAsync.Commit("message for commit"))
    .SelectMany(_ => GitAsync.Push("any_branch_name"))
    .Subscribe();

License

Copyright (c) 2017-2018 Tetsuya Mori

Released under the MIT license, see LICENSE.txt