Skip to content
This repository has been archived by the owner on Oct 15, 2022. It is now read-only.

Notes on windows build #91

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions server/buildRedis.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#! Build for linux/mac
# build redis
echo "building redis ------------------------------------"
wget https://download.redis.io/releases/redis-6.0.9.tar.gz
Expand Down
1 change: 1 addition & 0 deletions server/server.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#! WIN - this won't run in windows. Maybe solved by using external server.
# Replaces paths in redis config with the current and starts redis server.
# Not the best solution but it works.
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
Expand Down
7 changes: 5 additions & 2 deletions src/configHandler.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import * as os from "os";
import { existsSync, mkdirSync, copyFileSync } from "fs";

// ! WIN
// ! This has to be changed I have no idea how to handle this on windows.
// ! They don't seem to use dotfiles.
const DOT_R_PATH = os.homedir() + "/.reventlou";
const DEFAULT_CONFIG = DOT_R_PATH + "/default.json5";
const REDIS_DEFAULT_CONFIG = DOT_R_PATH + "/db/redis.conf";
Expand All @@ -18,7 +21,7 @@ export function configExists() {
}
if (!existsSync(DEFAULT_CONFIG)) {
console.log("default config doesn't exists. Creating it now.");
copyFileSync(__dirname + "/../config/default.json5", DEFAULT_CONFIG);
copyFileSync(__dirname + "/../config/default.json5", DEFAULT_CONFIG); // ! WIN
}
if (!existsSync(ARCHIVE)) {
console.log("archive doesn't exists. Creating it now.");
Expand All @@ -34,6 +37,6 @@ export function configExists() {
}
if (!existsSync(REDIS_DEFAULT_CONFIG)) {
console.log("default redis config doesn't exists. Creating it now.");
copyFileSync(__dirname + "/../config/redis.conf", REDIS_DEFAULT_CONFIG);
copyFileSync(__dirname + "/../config/redis.conf", REDIS_DEFAULT_CONFIG); // ! WIN
}
}
1 change: 1 addition & 0 deletions src/fileHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export async function exist(filePath: string): Promise<boolean> {
}

export function copyToArchive(filePath: string) {
//! WIN - dotfile issue again.
const filePathArr = filePath.split("/");
const destination = (
os.homedir() +
Expand Down
7 changes: 4 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ async function createWindow(): Promise<void> {
if (url.indexOf("explorer:file") != -1) {
shell.showItemInFolder(
os.homedir() +
"/.reventlou/" +
"/.reventlou/" + //! WIN dotfile issue
`${config.get("file.archive")}/${url}`.replace(
"explorer:file://",
""
Expand All @@ -74,7 +74,7 @@ async function createWindow(): Promise<void> {
} else {
shell.openPath(
os.homedir() +
"/.reventlou/" +
"/.reventlou/" + //! WIN dotfile issue
`${config.get("file.archive")}/${url}`.replace(
"file://",
""
Expand Down Expand Up @@ -199,7 +199,7 @@ if (process.env.NODE_ENV !== "production") {
{
label: "Icon Status Item",
click() {
addStatus("assets/icons/png/icon.png", undefined);
addStatus("assets/icons/png/icon.png", undefined); //! WIN this should work fine?
},
},
{
Expand Down Expand Up @@ -280,6 +280,7 @@ ipcMain.on("editor:save:value", function (_e, value) {
addStatus(undefined, status);
});

// autosuggestion
ipcMain.on("editor:suggest:value", function (_e, _value) {
// db.suggest(value);
log.debug("Needs implementation."); // TODO --> see db, github #1
Expand Down
4 changes: 2 additions & 2 deletions src/logger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ if (!get("log.silent")) {

log.appenders.set("everything", {
type: "file",
filename: os.homedir() + "/.reventlou/logs/" + get("log.file"),
filename: os.homedir() + "/.reventlou/logs/" + get("log.file"), //! WIN - dotfile
});
log.info(`Logging path: ${os.homedir()}/.reventlou/logs/${get("log.file")}`);
log.info(`Logging path: ${os.homedir()}/.reventlou/logs/${get("log.file")}`); //! - WIN dotfile
2 changes: 1 addition & 1 deletion src/redisServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { spawn } from "child_process";
import { log } from "./logger";

export function runRedis(): void {
const redis = spawn("sh", [__dirname + "/../server/server.sh"]);
const redis = spawn("sh", [__dirname + "/../server/server.sh"]); //!WIN - dotfile - also on windows we cannot exec bash scripts. Maybe solved by using external server.

redis.stdout.on("data", (data) => {
log.info(`[REDIS] ${data}`);
Expand Down