Skip to content

Commit

Permalink
Use app-data-folder
Browse files Browse the repository at this point in the history
  • Loading branch information
Sadegh Hayeri committed Mar 12, 2020
1 parent fe49c0d commit 5b8c8c3
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 28 deletions.
54 changes: 31 additions & 23 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
"test": "echo \"Error: no test specified\" && exit 1"
},
"dependencies": {
"app-data-folder": "^1.0.0",
"chalk": "^2.4.2",
"clear": "^0.1.0",
"consola": "^2.11.0",
Expand All @@ -41,7 +42,6 @@
"lru-cache": "^5.1.1",
"node-localstorage": "^2.1.5",
"ora": "^3.2.0",
"platform-folders": "^0.4.1",
"std-env": "^2.2.1",
"universal-analytics": "^0.4.20",
"update-notifier": "^2.5.0",
Expand Down
6 changes: 2 additions & 4 deletions src/utils/analytics.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import ua from 'universal-analytics';
import uuid from 'uuid/v4';
import { JSONStorage } from 'node-localstorage';
import path from 'path';
import appData from 'app-data-folder';

import getPath from 'platform-folders';
const configFolder = path.join(getPath('appData'), 'greentunnel');
const nodeStorage = new JSONStorage(configFolder);
const nodeStorage = new JSONStorage(appData('greentunnel'));
const userId = nodeStorage.getItem('userid') || uuid();
nodeStorage.setItem('userid', userId);

Expand Down

0 comments on commit 5b8c8c3

Please sign in to comment.