Skip to content

Commit

Permalink
Don't throw an error for uninstalled plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
pjeby committed Mar 5, 2024
1 parent c836f8b commit 916bd1e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,14 @@ on:
env:
PLUGIN_NAME: ${{ github.event.repository.name }}
RELEASE_VER: ${{ github.ref }}
COMMIT_MESSAGE: ${{ github.event.commits[0].message }}

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Create release and Upload
id: release
env:
Expand All @@ -27,8 +28,9 @@ jobs:
for f in main.js manifest.json styles.css; do
if [[ -f $f ]]; then
cp $f "${PLUGIN_NAME}/"
assets+=(-a "$f")
assets+=("$f")
fi
done
zip -r "$PLUGIN_NAME".zip "$PLUGIN_NAME"
hub release create "${assets[@]}" -a "$PLUGIN_NAME".zip -m "$TAG_NAME" "$TAG_NAME"
gh release create "$TAG_NAME" -t "$TAG_NAME" -n "### $COMMIT_MESSAGE"
gh release upload --clobber "$TAG_NAME" "${assets[@]}" "$PLUGIN_NAME".zip
2 changes: 1 addition & 1 deletion main.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ module.exports = class HotReload extends Plugin {
watch(path) {
if (this.app.vault.adapter.watchers.hasOwnProperty(path)) return;
const realPath = [this.app.vault.adapter.basePath, path].join("/");
const lstat = fs.lstatSync(realPath);
const lstat = fs.lstatSync(realPath, {throwIfNoEntry: false});
if (lstat && (watchNeeded || lstat.isSymbolicLink()) && fs.statSync(realPath).isDirectory()) {
this.app.vault.adapter.startWatchPath(path, false);
}
Expand Down
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"name": "Hot Reload",
"author": "PJ Eby",
"authorUrl": "https://github.com/pjeby",
"version": "0.1.10",
"version": "0.1.11",
"minAppVersion": "0.15.9",
"description": "Automatically reload in-development plugins when their files are changed",
"isDesktopOnly": true
Expand Down

0 comments on commit 916bd1e

Please sign in to comment.