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

book sm orders differently if .git folder is not present #11

Open
diginc opened this issue Dec 5, 2016 · 1 comment
Open

book sm orders differently if .git folder is not present #11

diginc opened this issue Dec 5, 2016 · 1 comment

Comments

@diginc
Copy link

diginc commented Dec 5, 2016

I have book.json with "sortedBy": "_", and several folders setup like:

2_Top
└── README.md
3_Mid
└── README.md
4_Mid2
└── README.md
5_Mid3
└── README.md
9_Last
├── 2_Top
│   └── README.md
├── 3_Mid
│   └── README.md
├── 9_Last
│   └── 3_Mid
│       └── README.md
└── README.md

My production deployment downloaded github's master.zip download link (e.g. like this link, but for my private repo), which doesn't have the .git folder in it, and ran book sm before starting gitbook serve. I noticed the ordering was not being obeyed the same as when the .git folder is present...any ideas why?

Here is an example SUMMARY.md output based off the above directory structure. The problem only presents itself when nesting data in the last sorted directory...

SUMMARY.md before git init of a repo:

- [Top](2_Top/README.md)
- [Mid 2](4_Mid2/README.md)
- [Mid 3](5_Mid3/README.md)
- [Last](9_Last/README.md)
  - [Top](9_Last/2_Top/README.md)
  - [Mid](9_Last/3_Mid/README.md)
  - Last
    - [Mid](9_Last/9_Last/3_Mid/README.md)
- [Mid](3_Mid/README.md)

after git init and add/commiting all the files...book sm results in:

- [Top](2_Top/README.md)
- [Mid](3_Mid/README.md)
- [Mid 2](4_Mid2/README.md)
- [Mid 3](5_Mid3/README.md)
- [Last](9_Last/README.md)
  - [Top](9_Last/2_Top/README.md)
  - [Mid](9_Last/3_Mid/README.md)
  - Last
    - [Mid](9_Last/9_Last/3_Mid/README.md)

I've worked around the issue by swithcing to a git clone --depth 1 so I have .git data...but I thought it was an odd bug worth reporting still.

@imfly
Copy link
Owner

imfly commented Dec 6, 2016

Hi,

It`s maybe a bug. 😢

.git should have been ignore https://github.com/imfly/gitbook-summary/blob/master/lib/summary/index.js#L138

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

No branches or pull requests

2 participants