smart-home-engine 0.16.0 → 0.16.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import{m as O}from"./monaco-langs-Decdf6BV.js";import{t as I}from"./index-Cqfuxa_i.js";/*!-----------------------------------------------------------------------------
1
+ import{m as O}from"./monaco-langs-Decdf6BV.js";import{t as I}from"./index-CBKdN3z6.js";/*!-----------------------------------------------------------------------------
2
2
  * Copyright (c) Microsoft Corporation. All rights reserved.
3
3
  * Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1)
4
4
  * Released under the MIT license
@@ -154,10 +154,10 @@
154
154
  }
155
155
  })();
156
156
  </script>
157
- <script type="module" crossorigin src="/assets/index-Cqfuxa_i.js"></script>
157
+ <script type="module" crossorigin src="/assets/index-CBKdN3z6.js"></script>
158
158
  <link rel="modulepreload" crossorigin href="/assets/monaco-langs-Decdf6BV.js">
159
159
  <link rel="stylesheet" crossorigin href="/assets/monaco-langs-DyX1CsEw.css">
160
- <link rel="stylesheet" crossorigin href="/assets/index-DcqBg4oJ.css">
160
+ <link rel="stylesheet" crossorigin href="/assets/index-6fsqE5Vy.css">
161
161
  </head>
162
162
  <body>
163
163
  <div id="app"></div>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "smart-home-engine",
3
- "version": "0.16.0",
3
+ "version": "0.16.1",
4
4
  "description": "Node.js based script runner for use in MQTT based Smart Home environments",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -132,12 +132,17 @@ router.use((req, res) => {
132
132
  }
133
133
  }
134
134
 
135
- // DELETE /she/scripts/<path> — delete file
135
+ // DELETE /she/scripts/<path> — delete file or directory (recursive)
136
136
  if (method === 'DELETE') {
137
137
  const abs = safePath(root, filePath);
138
138
  if (!abs) return res.status(400).json({ error: 'Invalid path' });
139
139
  try {
140
- fs.unlinkSync(abs);
140
+ const stat = fs.statSync(abs);
141
+ if (stat.isDirectory()) {
142
+ fs.rmSync(abs, { recursive: true });
143
+ } else {
144
+ fs.unlinkSync(abs);
145
+ }
141
146
  return res.json({ ok: true });
142
147
  } catch (err) {
143
148
  if (err.code === 'ENOENT') return res.status(404).json({ error: 'Not found' });