pinokiod 0.1.4 → 0.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/server/index.js +7 -1
- package/server/views/index.ejs +1 -1
package/package.json
CHANGED
package/server/index.js
CHANGED
|
@@ -1866,10 +1866,12 @@ class Server {
|
|
|
1866
1866
|
this.start(this.debug)
|
|
1867
1867
|
})
|
|
1868
1868
|
this.app.post("/config", async (req, res) => {
|
|
1869
|
+
console.log("/config", { body: req.body })
|
|
1869
1870
|
await this.configure(req.body)
|
|
1870
1871
|
|
|
1871
1872
|
// get the existing homedir
|
|
1872
1873
|
let existingHome = this.kernel.homedir
|
|
1874
|
+
console.log("Existinghome", existingHome)
|
|
1873
1875
|
|
|
1874
1876
|
// update the pinokio.json file
|
|
1875
1877
|
if (req.body.home && req.body.home.length > 0) {
|
|
@@ -1878,6 +1880,7 @@ class Server {
|
|
|
1878
1880
|
} else {
|
|
1879
1881
|
const basename = path.basename(req.body.home)
|
|
1880
1882
|
let isValidPath = (basename !== '' && basename !== req.body.home);
|
|
1883
|
+
console.log({isValidPath, basename})
|
|
1881
1884
|
if (isValidPath) {
|
|
1882
1885
|
// move the existing home directory to the new home directory
|
|
1883
1886
|
|
|
@@ -1892,6 +1895,7 @@ class Server {
|
|
|
1892
1895
|
// console.log("REMOVE DEST IF EXISTS")
|
|
1893
1896
|
// await fse.remove(req.body.home)
|
|
1894
1897
|
let exists = await fse.pathExists(req.body.home)
|
|
1898
|
+
console.log({ exists, home: req.body.home })
|
|
1895
1899
|
if (exists) {
|
|
1896
1900
|
res.json({ error: `The path ${req.body.home} already exists. Please remove the folder and retry` })
|
|
1897
1901
|
return
|
|
@@ -1934,6 +1938,7 @@ class Server {
|
|
|
1934
1938
|
// console.log("REMOVE DEST IF EXISTS")
|
|
1935
1939
|
// await fse.remove(defaultHome)
|
|
1936
1940
|
let exists = await fse.pathExists(defaultHome)
|
|
1941
|
+
console.log("Exists", exists)
|
|
1937
1942
|
if (exists) {
|
|
1938
1943
|
res.json({ error: `The path ${defaultHome} already exists. Please remove the folder and retry` })
|
|
1939
1944
|
return
|
|
@@ -1952,7 +1957,8 @@ class Server {
|
|
|
1952
1957
|
let defaultBin = path.resolve(defaultHome, "bin")
|
|
1953
1958
|
await rimraf(defaultBin)
|
|
1954
1959
|
|
|
1955
|
-
this.kernel.store.set("home", null)
|
|
1960
|
+
//this.kernel.store.set("home", null)
|
|
1961
|
+
this.kernel.store.set("home", defaultHome)
|
|
1956
1962
|
|
|
1957
1963
|
res.json({ success: true })
|
|
1958
1964
|
} catch (e) {
|
package/server/views/index.ejs
CHANGED