Skip to content

Conversation

@fgaz-scrive
Copy link

This is useful for example if you generate the haddocks and the index in CI and deploy them to another machine at a different path.


Thanks for the pull request!

By raising this pull request you confirm you are licensing your contribution under all licenses that apply to this project (see LICENSE) and that you have no patents covering your contribution.

If you care, my PR preferences are at https://github.com/ndmitchell/neil#contributions, but they're all guidelines, and I'm not too fussy - you don't have to read them.

@fgaz-scrive
Copy link
Author

Friendly ping

@fgaz-scrive
Copy link
Author

Ping :)

Is there anything I can do to move this forward?

@Bodigrim
Copy link
Collaborator

@fgaz-scrive could you please rebase to trigger a CI run?

| [] <- local_ -> do readHaskellOnline timing settings doDownload
| otherwise -> readHaskellDirs timing settings local_
| relocatable, _:_:_ <- local_ ->
exitFail "Error: --relocatable needs exactly one --local, or the paths will be ambiguous"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we validate this condition earlier? E. g., could our command line interface be --local [PATH] | --relocatable PATH, so that the configuration is valid by construction?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could our command line interface be --local [PATH] | --relocatable PATH

We'd still have to check that only one of those is supplied, unless cmdargs supports submodes and a breaking change is OK.

I pushed a separate commit with the change so you can compare and possibly revert.

@Bodigrim
Copy link
Collaborator

Bodigrim commented Dec 7, 2025

@fgaz @fgaz-scrive are you still interested in this?

@fgaz
Copy link

fgaz commented Dec 7, 2025

Yes, I'll follow up next week

This is useful for example if you generate the haddocks and the
index in CI and deploy them to another machine at a different path.
Copy link
Collaborator

@Bodigrim Bodigrim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! How can I test the new feature?

| Just _ <- relocatable, _:_ <- local_ ->
exitFail "Error: --relocatable and --local are mutually exclusive"
| Just relocatable' <- relocatable -> do
prefix <- traverse canonicalizePath relocatable
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could it be

Suggested change
prefix <- traverse canonicalizePath relocatable
prefix <- canonicalizePath relocatable'

?

let url = "file://" ++ ['/' | not $ "/" `isPrefixOf` dir] ++ replace "\\" "/" dir ++ "/"
let url = case prefixToRemove of
Just prefix -> makeRelative prefix $ replace "\\" "/" dir ++ "/"
Nothing -> "file://" ++ ['/' | not $ "/" `isPrefixOf` dir] ++ replace "\\" "/" dir ++ "/"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we please factor out replace "\\" "/" dir ++ "/" so that it's not repeated?

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

Successfully merging this pull request may close these issues.

3 participants