Support no .git folder - Can't mdbook build: called Option::unwrap() on a None value #15

Closed
opened 2023-12-04 14:55:51 +00:00 by joepio · 1 comment
joepio commented 2023-12-04 14:55:51 +00:00 (Migrated from github.com)

Hi there! I'm having some issues with running the mdbook build command

# After installing mdbook + open on gh...
2023-12-04 14:52:45 [INFO] (mdbook::book): Book building has started
thread 'main' panicked at /usr/local/cargo/registry/src/index.crates.io-6f17d22bba15001f/mdbook-open-on-gh-2.4.1/src/lib.rs:17:44:
called `Option::unwrap()` on a `None` value
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
2023-12-04 14:52:46 [ERROR] (mdbook::utils): Error: The "open-on-gh" preprocessor exited unsuccessfully with exit status: 101 status

Looks like it can't find the book root

Edit: I think it's because I don't have a .git folder, which is because of how my CI is setup. I'd like to be able to set my git using some sort of other setting in book.toml

Hi there! I'm having some issues with running the `mdbook build` command ``` # After installing mdbook + open on gh... 2023-12-04 14:52:45 [INFO] (mdbook::book): Book building has started thread 'main' panicked at /usr/local/cargo/registry/src/index.crates.io-6f17d22bba15001f/mdbook-open-on-gh-2.4.1/src/lib.rs:17:44: called `Option::unwrap()` on a `None` value note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace 2023-12-04 14:52:46 [ERROR] (mdbook::utils): Error: The "open-on-gh" preprocessor exited unsuccessfully with exit status: 101 status ``` Looks like it can't find the [`book root`](https://github.com/badboy/mdbook-open-on-gh/blob/ce6d92097a9e0e01473470553c933148e03e7a47/src/lib.rs#L17) Edit: I think it's because I don't have a `.git` folder, which is because of how my CI is setup. I'd like to be able to set my git using some sort of other setting in `book.toml`
badboy commented 2023-12-05 09:25:25 +00:00 (Migrated from github.com)

This plugin looks for the .git folder to determine the root of the project. I'm not eager to support another way, so if you want to use it all you have to do in your CI setup is mkdir $PROJECT_ROOT/.git and it should work.

This plugin looks for the `.git` folder to determine the root of the project. I'm not eager to support another way, so if you want to use it all you have to do in your CI setup is `mkdir $PROJECT_ROOT/.git` and it should work.
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
jer/mdbook-open-on-gh#15
No description provided.