kangwonlee / kangwonlee/tutorial

Detect shell command error

オープン
#14 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
bug
主要言語
Jupyter Notebook
スター
1
フォーク
1
PR マージ指標
30日以内にマージされた PR はありません

説明

* `git checkout ` does not raise an exception
* `out = !git checkout ` would capture the output error message but seems not exactly desirable as a tutorial
* `%%script bash --out stdout --err stderr` captures `stdout` and `stderr` respectively

## References

* https://stackoverflow.com/questions/35857230/ipython-raise-exception-when-a-shell-command-fails
* https://jakevdp.github.io/PythonDataScienceHandbook/01.05-ipython-and-shell-commands.html
* https://ipython.readthedocs.io/en/stable/interactive/magics.html#cellmagic-script

## Observation

* Following cell would raise an error

``` sh
%%bash --out stdout --err stdout
git checkout
```

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

調査の方向性

ソースファイルやノートブックのパスは指定されていません。`%%bash --out stdout --err stdout` の例から始め、リンクされている IPython cell-magic のドキュメントと参考資料を読んで、ゼロ以外のシェル終了ステータスをどのように扱うべきかを判断してください。無効な `git checkout` コマンドに対して意図されたエラー動作がチュートリアルで明確に示されれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
bash, git, jupyter-notebook
領域
cli, documentation
issue の種類
機能追加
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
説明が足りない
初心者へのやさしさ
32/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。