Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getDirectory("shell")でshell/masterとshell/hogeの区別がつかない #12

Open
legokichi opened this issue Dec 1, 2015 · 5 comments

Comments

@legokichi
Copy link
Member

No description provided.

@legokichi
Copy link
Member Author

NanikaDirectory.prototype.parseで
shell/hoge/install.txtが発見されると
自動的にshell/master/_とshell/hoge/_がマージされて*になるようだ

@legokichi
Copy link
Member Author

raychel_second.nar には
shell/master/*shell/kisekase/*が存在する。
このとき、

NarLoader.loadFromURL("raychel_second.nar").then (nanikaDir)->
  shelldirs = nanikaDir.getDirectory("shell").listChildren()
  # dir は ["master", "kisekae"] であってほしい
  # しかし現行では  ["surface0.png"...]

しかし shell/kisekae/install.txt があるため、 NanikaDirectory.prototype.parse
nowarp.length is 0 and wraped.length is 1 のフラグが立ってしまい、
ghostname/install.txt -> install.txt が働いてしまう。
そのため、shell/mastershell/kisekae がマージされてしまう。

ghostname/install.txt -> install.txt を抑制するにはどうすればいいでしょうか?

@Narazaka
Copy link
Member

Narazaka commented Dec 1, 2015

ちょいと考えます。

@legokichi
Copy link
Member Author

https://github.com/legokichi/NarLoader/blob/issue12/NarLoader.coffee#L17

loadFromBufferでnew NanikaDirectoryするときにis_rootDirオプションつけるようにしてみました

https://github.com/legokichi/NarLoader/blob/issue12/NarLoader.coffee#L90

これでRootDirのときだけ ghostname潰せるようになりましたが解決策としてこれで良いのでしょうか

@Narazaka
Copy link
Member

Narazaka commented Dec 9, 2015

他に良い策も思いつかないのでそれで良いと思います。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants