@xiaobai-world/upload
Advanced tools
Comparing version 0.0.67 to 0.0.68
{ | ||
"name": "@xiaobai-world/upload", | ||
"version": "0.0.67", | ||
"version": "0.0.68", | ||
"description": "upload to xiaobai store", | ||
@@ -5,0 +5,0 @@ "main": "./src/index.js", |
@@ -1,3 +0,5 @@ | ||
const base = "http://localhost:3001"; | ||
const base = process.env.xiaobai_backend | ||
? process.env.xiaobai_backend | ||
: "http://www.xiaobai.world/"; | ||
module.exports = { base }; |
const fs = require("fs"); | ||
const path = require("path"); | ||
const { base } = require("./const"); | ||
const { createHash } = require("crypto"); | ||
const hash = createHash(`sha256`); | ||
hash.update(base); | ||
const baseHash = hash.digest('hex') | ||
function getHomeDir() { | ||
return path.join(process.env.HOME, ".xiaobai-world"); | ||
return path.join(process.env.HOME, `.xiaobai-world-${baseHash}`); | ||
} | ||
@@ -7,0 +12,0 @@ |
9585
287