diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 43aea3e..0830f81 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -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: @@ -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 diff --git a/main.js b/main.js index ba2fbd1..5785df0 100644 --- a/main.js +++ b/main.js @@ -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); } diff --git a/manifest.json b/manifest.json index 87d2dbc..0581332 100644 --- a/manifest.json +++ b/manifest.json @@ -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