kangwonlee / kangwonlee/tutorial

Detect shell command error

Aperta
#14 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
bug
Lingua principale
Jupyter Notebook
Stelle
1
Fork
1
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

* `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
```

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Direzione di ricerca

No source file or notebook path is named. Start with the `%%bash --out stdout --err stdout` example and read the linked IPython cell-magic documentation and references to determine how nonzero shell exit status should be handled. Done means the tutorial clearly demonstrates the intended error behavior for the invalid `git checkout` command.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
bash, git, jupyter-notebook
Ambito
cli, documentation
Tipo di issue
Funzionalità
Difficoltà
3/5
Tempo stimato
1-2 giorni
Stato di attività
Ferma
Chiarezza
Da chiarire
Idoneità per principianti
32/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.