Skip to content

Commit d998dcf

Browse files
refactor: rename folder to directory for constancy
1 parent a344350 commit d998dcf

File tree

4 files changed

+21
-21
lines changed

4 files changed

+21
-21
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -792,7 +792,7 @@ Huge shout out to [shbatm](https://github.com/shbatm) for his work on this new m
792792
- Menu to update your MagicMirror² installation and your modules (through `git pull`)
793793
- Menu to change the `config.js`
794794
- Modules can be installed, added, removed, configured
795-
- There will be backups of the five last versions of the `config.js` in the `config` folder
795+
- There will be backups of the five last versions of the `config.js` in the `config` directory
796796
- Some of these parts are hidden behind an "experimental" warning, do **not** ignore that warning
797797
- NOTIFICATION action, see [README.md](README.md#notification-request) for details
798798

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ The module also includes a **RESTful API** for controlling all aspects of your m
3535

3636
## Installation
3737

38-
1. Clone this repository in your `modules` folder, and install dependencies:
38+
1. Clone this repository in your `modules` directory, and install dependencies:
3939

4040
```bash
4141
cd ~/MagicMirror/modules
@@ -106,7 +106,7 @@ You can install the remote control as an app on your smartphone:
106106
107107
### Update
108108
109-
Update this module by navigating into its folder on the command line and using `git pull`:
109+
Update this module by navigating into its directory on the command line and using `git pull`:
110110
111111
```bash
112112
cd ~/MagicMirror/modules/MMM-Remote-Control
@@ -283,15 +283,15 @@ Group modules to show/hide together with a single action. See the [Classes Guide
283283
284284
Create custom buttons in the web interface. See the [Custom Menus Guide](docs/guide/custom-menus.md) for details.
285285
286-
Copy `custom_menu.example.json` to your MagicMirror `config/` folder, rename it, and add to your config:
286+
Copy `custom_menu.example.json` to your MagicMirror `config/` directory, rename it, and add to your config:
287287
288288
```js
289289
customMenu: "custom_menu.json",
290290
```
291291
292292
## Documentation
293293
294-
For detailed documentation, see the [docs/guide/](docs/guide/) folder:
294+
For detailed documentation, see the [docs/guide/](docs/guide/) directory or the following links:
295295
296296
- [Configuration](docs/guide/configuration.md) - All config options
297297
- [Monitor Control](docs/guide/monitor-control.md) - Wayland, X11, CEC commands

docs/guide/custom-menus.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Create custom menu buttons for the Remote Control web interface.
44

55
## Setup
66

7-
1. Copy `custom_menu.example.json` from the module folder to your MagicMirror `config/` folder
7+
1. Copy `custom_menu.example.json` from the module directory to your MagicMirror `config/` directory
88
2. Rename it (e.g., `custom_menu.json`)
99
3. Add the filename to your config:
1010

@@ -154,7 +154,7 @@ Send notifications to any module:
154154

155155
## Translations
156156

157-
Use `%%TRANSLATE:KEY%%` in your text and add the translation to the files in the `translations/` folder:
157+
Use `%%TRANSLATE:KEY%%` in your text and add the translation to the files in the `translations/` directory:
158158

159159
```json
160160
{

node_helper.js

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -250,28 +250,28 @@ module.exports = NodeHelper.create({
250250
: "modules");
251251
},
252252

253-
addModule (folderName, lastOne) {
254-
const modulePath = `${this.getModuleDir()}/${folderName}`;
253+
addModule (directoryName, lastOne) {
254+
const modulePath = `${this.getModuleDir()}/${directoryName}`;
255255
fs.stat(modulePath, (error, stats) => {
256256
if (stats.isDirectory()) {
257257
let currentModule = null;
258-
this.modulesInstalled.push(folderName);
258+
this.modulesInstalled.push(directoryName);
259259
for (const module of this.modulesAvailable) {
260-
if (module.longname === folderName) {
260+
if (module.longname === directoryName) {
261261
module.installed = true;
262262
currentModule = module;
263263
break;
264264
}
265265
}
266266
if (!currentModule) {
267267
const newModule = {
268-
longname: folderName,
269-
name: folderName,
268+
longname: directoryName,
269+
name: directoryName,
270270
isDefaultModule: false,
271271
installed: true,
272272
author: "unknown",
273273
desc: "",
274-
id: `local/${folderName}`,
274+
id: `local/${directoryName}`,
275275
url: ""
276276
};
277277
this.modulesAvailable.push(newModule);
@@ -296,13 +296,13 @@ module.exports = NodeHelper.create({
296296
this.pendingUpdateChecks = 0;
297297
}
298298
this.pendingUpdateChecks++;
299-
Log.debug(`Queuing update check for ${folderName}, pending: ${this.pendingUpdateChecks}`);
299+
Log.debug(`Queuing update check for ${directoryName}, pending: ${this.pendingUpdateChecks}`);
300300

301301
// Add to queue instead of executing immediately
302302
this.updateCheckQueue.push({
303303
module: currentModule,
304304
modulePath,
305-
folderName
305+
directoryName
306306
});
307307

308308
// Start processing queue
@@ -322,13 +322,13 @@ module.exports = NodeHelper.create({
322322
currentModule.url = baseUrl.replace("git@", "https://");
323323
} catch (error) {
324324
// Something happened. Skip it.
325-
Log.debug(`Could not get remote URL for module ${folderName}: ${error}`);
325+
Log.debug(`Could not get remote URL for module ${directoryName}: ${error}`);
326326

327327
}
328328
});
329329
}
330330
} catch {
331-
Log.debug(`Module ${folderName} is not managed with git, skipping update check`);
331+
Log.debug(`Module ${directoryName} is not managed with git, skipping update check`);
332332
}
333333
}
334334
});
@@ -353,15 +353,15 @@ module.exports = NodeHelper.create({
353353

354354
if (data.behind > 0) {
355355
check.module.updateAvailable = true;
356-
Log.info(`Module ${check.folderName} has updates available (behind ${data.behind} commits)`);
356+
Log.info(`Module ${check.directoryName} has updates available (behind ${data.behind} commits)`);
357357
}
358358
} catch (error) {
359-
Log.warn(`Error checking updates for ${check.folderName}: ${error.message || error}`);
359+
Log.warn(`Error checking updates for ${check.directoryName}: ${error.message || error}`);
360360
} finally {
361361
this.activeUpdateChecks--;
362362
this.pendingUpdateChecks--;
363-
Log.debug(`Finished update check for ${check.folderName}, pending: ${this.pendingUpdateChecks}, active: ${this.activeUpdateChecks}, queued: ${this.updateCheckQueue.length}`);
364363

364+
Log.debug(`Finished update check for ${check.directoryName}, pending: ${this.pendingUpdateChecks}, active: ${this.activeUpdateChecks}, queued: ${this.updateCheckQueue.length}`);
365365
// Process next item in queue
366366
this.processUpdateCheckQueue();
367367
}

0 commit comments

Comments
 (0)