This commit is contained in:
Artur Gurgul 2024-10-17 23:51:03 +02:00
parent d086c1d493
commit 0f1d41a991
30 changed files with 1013 additions and 1536 deletions

View file

@ -1,5 +1,6 @@
import { fileURLToPath } from 'url'
import path from 'path'
import fs from 'fs'
import { cp } from './utils.js'
// Get the directory of the current file
@ -15,6 +16,57 @@ export function newProject() {
cp(DEFAULT_PROJECT_PATH, ".")
}
import { readConfig } from './site.js'
import { build } from './site.js'
export function buildProject() {
const ignore = [".build", ".site"]
console.log("building")
let config = {
... readConfig(),
buildDir: './.build',
ignore: [".build", ".sajt"]
}
config.remote.port = 22
config.remote.privateKey = fs.readFileSync(path.resolve(process.env.HOME, '.ssh/id_rsa'))
build(config)
//loadTemplate()
//parseMD()
//buildProject(config)
}
//import { run } from './src/desktop/main.js'
import * as proc from 'child_process'
//import { app, BrowserWindow } from 'electron'
import * as electron from 'electron'
export function appProject() {
//run()
//const child = proc.spawn(electron, ["."])
console.log(electron)
console.log(electron.default)
const child = proc.spawn(electron.default, [".build"])
// https://www.matthewslipper.com/2019/09/22/everything-you-wanted-electron-child-process.html
// exec('node start', (error, stdout, stderr) => {
// if (error) {
// console.error(`error: ${error.message}`)
// return;
// }
// if (stderr) {
// console.error(`stderr: ${stderr}`);
// return
// }
// console.log(`stdout:\n${stdout}`)
// })
}