0% found this document useful (0 votes)
5 views3 pages

Mahavidya v1 Build Script Guide

Uploaded by

Jaydip Gupte
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views3 pages

Mahavidya v1 Build Script Guide

Uploaded by

Jaydip Gupte
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Mahavidya v1 Build Script

#!/bin/bash
set -e

# ==============================
# Mahavidya v1 – Build Script
# ==============================

# 1) Create project folder


cd ~/Desktop
rm -rf Mahavidya-v1
mkdir Mahavidya-v1
cd Mahavidya-v1

# 2) [Link]
cat > [Link] <<'EOF'
{
"name": "mahavidya",
"version": "1.0.0",
"description": "Mahavidya – Writing & Publishing Pad",
"main": "[Link]",
"type": "commonjs",
"author": "Jaydip Gupte & Kmakhya",
"license": "Proprietary",
"scripts": {
"start": "electron .",
"dist": "electron-builder"
},
"devDependencies": {
"electron": "^30.0.0",
"electron-builder": "^24.6.0",
"jsdom": "^24.0.0"
}
}
EOF

# 3) [Link]
cat > [Link] <<'EOF'
const { app, BrowserWindow, ipcMain, dialog } = require('electron');
const path = require('path');
const fs = require('fs');
let mainWindow;

function createWindow () {
mainWindow = new BrowserWindow({
width: 1200,
height: 800,
webPreferences: {
contextIsolation: true,
preload: [Link](__dirname, '[Link]')
}
});

[Link]('[Link]');
}

[Link]().then(createWindow);

[Link]('save-file', async (event, content) => {


const { canceled, filePath } = await [Link]({
filters: [{ name: 'Documents', extensions: ['txt','md','html'] }]
});
if (!canceled && filePath) {
[Link](filePath, content, 'utf-8');
return { filePath };
}
return { canceled: true };
});
EOF

# 4) [Link]
cat > [Link] <<'EOF'
const { contextBridge, ipcRenderer } = require('electron');

[Link]('mahavidya', {
save: (text) => [Link]('save-file', text)
});
EOF

# 5) [Link]
cat > [Link] <<'EOF'
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Mahavidya</title>
<style>
body { font-family: system-ui, sans-serif; margin:0; display:flex; flex-direction:column;
height:100vh; }
header { padding:10px; background:#4b0082; color:white; display:flex; justify-
content:space-between; align-items:center; }
#editor { flex:1; padding:15px; font:16px/1.6 ui-monospace; outline:none; border:none;
resize:none; }
button { padding:6px 12px; border:none; border-radius:6px; cursor:pointer; }
</style>
</head>
<body>
<header>
<h1>Mahavidya v1</h1>
<button id="saveBtn">💾 Save</button>
</header>
<textarea id="editor" placeholder="Start writing your masterpiece..."></textarea>
<script>
const editor = [Link]('editor');
[Link]('saveBtn').addEventListener('click', async () => {
const res = await [Link]([Link]);
if (![Link]) alert('Saved to ' + [Link]);
});
</script>
</body>
</html>
EOF

# 6) Install dependencies
npm install

echo "==================================="
echo "Mahavidya v1 ready."
echo "Run app: npm start"
echo "Build DMG: npm run dist"
echo "==================================="

You might also like