Skip to content

Commit

Permalink
Prepared for release 1.3.0, added scripts to build release and copy f…
Browse files Browse the repository at this point in the history
…iles to obsidian testing vault, updated readme and gitignore
  • Loading branch information
KrazyManJ committed Dec 26, 2022
1 parent d7090f4 commit ee2a26d
Show file tree
Hide file tree
Showing 7 changed files with 204 additions and 10 deletions.
7 changes: 5 additions & 2 deletions .gitignore
Expand Up @@ -21,5 +21,8 @@ data.json
# Exclude macOS Finder (System Explorer) View States
.DS_Store

# Release zip
obsidian-keyshots-*.zip
# Release folder
release

# Paths
paths.mjs
1 change: 1 addition & 0 deletions README.md
Expand Up @@ -72,6 +72,7 @@ Now you can choose from these IDEs:

- Visual Studio Code
- JetBrains IDEs Family (IntelliJ IDEA, PyCharm, WebStorm, ... )
- Microsoft Visual Studio (**NEW IN** 1.3.0)

## ⚠️ Read before usage:

Expand Down
22 changes: 22 additions & 0 deletions build_release.mjs
@@ -0,0 +1,22 @@
import JSZip from "jszip"
import {readFileSync, unlinkSync, createWriteStream, mkdirSync, existsSync, copyFileSync, readdirSync} from "fs";
import {join} from "path"


if (!existsSync("release")) mkdirSync("release")

readdirSync("release").forEach( (file) => {
if (file.endsWith(".zip")) unlinkSync(join("release", file));
});

const release_zip = new JSZip();

const manifest = readFileSync("manifest.json")
const version = JSON.parse(manifest)["version"]
release_zip.file("obsidian-keyshots/manifest.json",manifest)
release_zip.file("obsidian-keyshots/main.js",readFileSync("main.js"))

release_zip.generateNodeStream({ type: 'nodebuffer', streamFiles: true })
.pipe(createWriteStream(`release/obsidian-keyshots-${version}.zip`));

["main.js","manifest.json"].forEach(f => copyFileSync(f,`release/${f}`));
4 changes: 4 additions & 0 deletions copy_to_vault.mjs
@@ -0,0 +1,4 @@
import { existsSync, copyFileSync } from "fs";
import DEV_TEST_PLUGIN_PATH from "./paths.mjs";
if (!existsSync(DEV_TEST_PLUGIN_PATH)) { throw new Error("Destination does not exist!"); };
["main.js","manifest.json"].forEach(f => copyFileSync(f,`${DEV_TEST_PLUGIN_PATH}${f}`));
2 changes: 1 addition & 1 deletion manifest.json
@@ -1,7 +1,7 @@
{
"id": "keyshots",
"name": "Keyshots",
"version": "1.2.0",
"version": "1.3.0",
"minAppVersion": "0.15.0",
"description": "Adds classic hotkey/shortcuts commands from popular IDEs like Visual Studio Code or JetBrains Family.",
"author": "KrazyManJ",
Expand Down

0 comments on commit ee2a26d

Please sign in to comment.