Skip to content

Commit 2a0b91a

Browse files
committed
docs update, adapt init script for windows
1 parent 3e89229 commit 2a0b91a

File tree

3 files changed

+31
-4
lines changed

3 files changed

+31
-4
lines changed

bin/scripts/init.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ export default async () => {
4242

4343
if (project_path) {
4444
project_path = './' + project_path
45-
.replace(/^[\/\.]+/, '')
46-
.replace(/\/+$/, '');
45+
.replace(/^[\/\.\\]+/, '')
46+
.replace(/(\/|\\)+$/, '');
4747
} else {
4848
project_path = '.';
4949
}
@@ -58,7 +58,7 @@ export default async () => {
5858
for (const file of files) {
5959
const stat = await fs.stat(file);
6060
const is_dir = stat.isDirectory();
61-
const filename = file.split('/').slice(-1)[0];
61+
const filename = file.split(path.sep).slice(-1)[0];
6262

6363
if (ignore.includes(filename)) {
6464
continue;

docs/docs/modules/console.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
sidebar_position: 3
3+
---
4+
5+
# console
6+
7+
this module is used for creating console scripts that are intended to run independently from the rest of the application. these could be invoked by a developer manually or via cronjobs.
8+
9+
## concept
10+
11+
zero or more files are created in the `console` directory. each file represents a single script that can be ran. these scripts inherit all the same environment that the main application has, so from a runtime standpoint, both are equivalent.
12+
13+
## file structure
14+
15+
a console script looks like this:
16+
17+
```js title="console/sample.js"
18+
export default new class {
19+
20+
async run() {
21+
// do something here
22+
console.log('running console command `sample`');
23+
}
24+
25+
};
26+
27+
```

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "@exajs/core",
33
"type": "module",
44
"author": "Brian Seymour <@realtux>",
5-
"version": "0.0.16",
5+
"version": "0.0.17",
66
"description": "modern opinionated node.js framework",
77
"license": "MIT",
88
"homepage": "https://github.com/realtux/exa",

0 commit comments

Comments
 (0)