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

Windows paths are not escaped correctly #11

Open
trytriangles opened this issue Jan 8, 2018 · 6 comments
Open

Windows paths are not escaped correctly #11

trytriangles opened this issue Jan 8, 2018 · 6 comments

Comments

@trytriangles
Copy link

trytriangles commented Jan 8, 2018

Windows paths use \ as the separator. When Exocortex writes its config file, it doesn't properly escape those slashes, meaning that when the config gets parsed each separator is interpreted as an attempt at writing an escape character, which always results in a fatal error.

C:\Users\Ryan > exo new test
   • Creating your new wiki: test
   • Successfully created your wiki: cd C:\Users\Ryan\test && exo start

C:\Users\Ryan > cd test && exo start
    ⨯ exo: Config file required to start wiki: While parsing config: invalid character 'U' in string escape code
@SpencerCDixon
Copy link
Owner

Whoops! Thanks for filing, I'll get a fix in soon

@SpencerCDixon
Copy link
Owner

Hmmm seems like I'm using filepath.Join in most places... @ryantriangles is it just failing to create the exocortex.json file in your test dir? If it did create one can you paste me the contents?

@kempjeng
Copy link

kempjeng commented Jan 8, 2018

I have the same issue, no problems creating the exocortext.json file. Exact same error message.

Exo starts if I edit the json file to escape the paths manually.

@SpencerCDixon
Copy link
Owner

Could either of you paste me your .json file? So sounds like it's the repository field that is incorrect?

@trytriangles
Copy link
Author

trytriangles commented Jan 8, 2018

It successfully creates one, it's just writing a Windows path as-is. The error is helpfully highlighted by GitHub's JSON highlighting.

{
  "server": {
    "host": "localhost",
    "port": 1234
  },
  "repository": "D:\temp\hello",
  "syncInterval": 30,
  "title": "My Wiki",
  "remote": "origin",
  "branch": "master"
}

@shonlove
Copy link

shonlove commented Nov 8, 2018

#18 is intended to fix this issue.

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

4 participants