theoretically patch broken windows install

This commit is contained in:
dragonwocky 2020-08-11 09:32:22 +10:00
parent ff41cb78d5
commit 606f6e6325
Signed by: dragonwocky
GPG Key ID: C7A48B7846AA706D
4 changed files with 6 additions and 10 deletions

View File

@ -13,6 +13,7 @@ want to contribute? check the the [contribution guidelines](CONTRIBUTING.md).
## installation
1. install node.js: [windows/macOS](https://nodejs.org/en/download/), [linux/WSL](https://github.com/mklement0/n-install).
if on windows, the next steps will need to be done in the newly installed "node.js command prompt".
2. install notion-enhancer globally via yarn or npm:
`npm i -g notion-enhancer` or `yarn global add notion-enhancer`
3. ensure no notion processes are running (you may want to check the task manager to make sure),

2
bin.js
View File

@ -22,7 +22,7 @@ const cli = require('cac')(),
cli.option('-y, --yes', ': skip prompts (may overwrite data)');
cli
.command('apply', ': add enhancements to the notion app')
.command('apply', ': add the enhancer to the notion app')
.action(async (options) => {
console.info('=== NOTION ENHANCEMENT LOG ===');
await require('./pkg/apply.js')();

View File

@ -212,6 +212,7 @@ s {
padding: 0.2em 0.5em;
margin-top: 0.5em;
background: var(--theme_local--card);
color: var(--theme_local--overlay);
border-radius: 2px;
transition: background 200ms;
user-select: none;

View File

@ -9,8 +9,7 @@
const fs = require('fs-extra'),
path = require('path'),
{ readdirIterator } = require('readdir-enhanced'),
{ promisify } = require('util'),
{ exec } = require('child_process'),
{ extractAll } = require('asar'),
helpers = require('./helpers.js'),
{ version } = require('../package.json');
@ -57,13 +56,8 @@ module.exports = async function ({ overwrite_version } = {}) {
});
}
console.info(' ...unpacking app.asar');
const asar_app = path.resolve(`${__notion}/app.asar`),
asar_exec = path.resolve(`${__dirname}/../node_modules/asar/bin/asar.js`);
await promisify(exec)(
`"${asar_exec}" extract "${asar_app}" "${path.resolve(
`${__notion}/app`
)}"`
);
const asar_app = path.resolve(`${__notion}/app.asar`);
extractAll(asar_app, `${path.resolve(`${__notion}/app`)}`);
fs.move(asar_app, path.resolve(`${__notion}/app.asar.bak`));
// patching launch script target of custom wrappers