# HG changeset patch # User Ludovic Chabant # Date 1669696753 28800 # Node ID 141f0a7d1986e0aabf5ba429084925ce02f6ef20 # Parent cfd1b1b6768a985320e8df0c997612253eab9875 Better error handling for npm dogfood command. Expand the README info. diff -r cfd1b1b6768a -r 141f0a7d1986 README.md --- a/README.md Thu Jul 14 14:47:04 2022 -0700 +++ b/README.md Mon Nov 28 20:39:13 2022 -0800 @@ -1,4 +1,4 @@ -## Remember File State +# Remember File State This [Obsidian](https://obsidian.md) plugin remembers the editor state of files as you switch between them. It restores the cursor position, scrolling position, @@ -7,3 +7,20 @@ Note that this plugin doesn't currently remember state across sessions. + +## Developer Quickstart + +My own workflow for working on this plugin is the following: + +1. Install the "_Remember File State_" plugin in a test vault. Don't forget to + enable it. +2. Clone the `obsidian-remember-file-state` repository. +3. Run the usual incantations, such as `npm install`. +4. Run the build process in watch mode so that it compiles the TypeScript code + and overwrites the test vault's plugin: `npm run dogfood + /path/to/vault/.obsidian/plugins/obsidian-remember-state`. +5. When making changes, trigger the "_Reload App Without Saving_" command to + reload Obsidian. +6. Optionally, hit `Ctrl-Shift-I` to open the developer console and see the + console log. + diff -r cfd1b1b6768a -r 141f0a7d1986 esbuild.config.mjs --- a/esbuild.config.mjs Thu Jul 14 14:47:04 2022 -0700 +++ b/esbuild.config.mjs Mon Nov 28 20:39:13 2022 -0800 @@ -12,10 +12,12 @@ const prod = (process.argv[2] === 'production'); var outdir = (process.argv[2] === 'dogfood' ? process.argv[3] : ''); -if (outdir != '') { +if (outdir != undefined && outdir != '') { if (outdir.slice(-1) != '/' && outdir.slice(-1) != "\\") { outdir += '/'; } +} else { + throw("Please provide an output directory to put the dog food into"); } const outfile = outdir + 'main.js';