fix: better cli

This commit is contained in:
Sebastian Rindom
2021-05-02 23:20:35 +02:00
parent df5018669c
commit 953747f3d2
7 changed files with 112 additions and 39 deletions
@@ -0,0 +1,20 @@
const ConfigStore = require("configstore")
let config
module.exports = {
getToken: function() {
if (!config) {
config = new ConfigStore(`medusa`, {}, { globalConfigPath: true })
}
return config.get("login_token")
},
setToken: function(token) {
if (!config) {
config = new ConfigStore(`medusa`, {}, { globalConfigPath: true })
}
return config.set("login_token", token)
},
}