Skip to content

Commit

Permalink
Makefile: work around the case the repository is cloned without "--re…
Browse files Browse the repository at this point in the history
…cursive"
  • Loading branch information
akinomyoga committed Sep 22, 2021
1 parent 08e903e commit 22ace5f
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 9 deletions.
11 changes: 3 additions & 8 deletions GNUmakefile
Expand Up @@ -108,15 +108,10 @@ $(OUTDIR)/doc/%: % | $(OUTDIR)/doc
# contrib

.PHONY: update-contrib
update-contrib:
update-contrib contrib/.git contrib/contrib.mk:
git submodule update --init --recursive
contrib/.git:
git submodule update --init --recursive
outdirs += $(OUTDIR)/contrib $(OUTDIR)/contrib/airline
contrib-files = $(wildcard contrib/*.bash contrib/airline/*.bash)
outfiles += $(contrib-files:contrib/%=$(OUTDIR)/contrib/%)
$(OUTDIR)/contrib/%.bash: contrib/%.bash | contrib/.git $(OUTDIR)/contrib $(OUTDIR)/contrib/airline
cp -p $< $@

include contrib/contrib.mk

#------------------------------------------------------------------------------
# target "all"
Expand Down
2 changes: 1 addition & 1 deletion contrib
Submodule contrib updated 1 files
+16 −0 contrib.mk
1 change: 1 addition & 0 deletions memo/ChangeLog.md
Expand Up @@ -102,6 +102,7 @@
- term: update `vte` identification `#D1620` 00e74d8
- edit: suppress only `stderr` with `internal_suppress_bash_output` (motivated by rashil2000) `#D1646` a30887f
- prompt: do not evaluate `PROMPT_COMMAND` for subprompts `#D1654` 0000000
- Makefile: work around the case the repository is cloned without `--recursive` `#D1655` 0000000

## Fixes

Expand Down
16 changes: 16 additions & 0 deletions note.txt
Expand Up @@ -5374,6 +5374,22 @@ bash_tips

2021-09-22

* Makefile: 単なる git clone & make install でちゃんとインストールできる様にしたい [#D1655]
https://github.com/Bash-it/bash-it/pull/1884#issuecomment-922615431

特に --recursive をユーザーが指定しなかった時。
現在の実装だと contrib が存在しなかった場合には一回の make だけだと
contrib 以下のインストールするべきファイルが認識されずにインストールされない。
contrib を checkout した時には改めてそれを読み直す様にさせる必要がある。

うーん。これは GNUmakefile を contrib/.git に依存させれば良いのでは?
という気がする。但し、何か変な事が起こるかもしれないので、
何回か手元で実行して確認する必要がある。

うーん。駄目だ最初からやり直してはくれない。実際に Makefile が書き換えられ
る事がないと駄目という事だろうか。contrib の方に .mk を作成してそれを読み込
む様にしなければならないのだろうか。取り敢えずその様に実験してみる事にする。

* prompt: do not evaluate PROMPT_COMMAND for subprompts [#D1654]

#D1654 で観察していて気づいたが現在のコードだと subprompt に対しても
Expand Down

0 comments on commit 22ace5f

Please sign in to comment.