Skip to content

Commit

Permalink
now escaping semicolons in username, passwords and Confluence Base URL
Browse files Browse the repository at this point in the history
  • Loading branch information
skleinei committed Feb 10, 2018
1 parent 31f8bd5 commit ac7c37a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Being command-line the viewport-tools should be installed globally.
$ npm install -g viewport-tools
```

If that doesn't work try to ``sudo`` the above command.
If that doesn't work, try ``$ sudo npm install -g viewport-tools``.


## Usage
Expand Down
6 changes: 6 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,12 @@ function createViewportrc(action) {
viewportRc['DEV_' + new Date().toISOString().substring(0, 19)] = viewportRc.DEV;
}

// we need to replace semicolons, because they start comments in ini files
// more info: https://github.com/npm/ini/issues/42
action.viewportrc.confluenceBaseUrl = action.viewportrc.confluenceBaseUrl.replace(/\;/, '\;');
action.viewportrc.username = action.viewportrc.username.replace(/\;/, '\;');
action.viewportrc.password = action.viewportrc.password.replace(/\;/, '\;');

viewportRc.DEV = action.viewportrc;
viewportRc.save('.viewportrc');

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "viewport-tools",
"version": "0.0.2",
"version": "0.0.3",
"description": "Developer tools for Scroll Viewport theme developers (more info: https://www.k15t.com/software/scroll-viewport).",
"preferGlobal": true,
"bin": {
Expand Down

0 comments on commit ac7c37a

Please sign in to comment.