Skip to content

Commit

Permalink
docs update, adapt init script for windows
Browse files Browse the repository at this point in the history
  • Loading branch information
realtux committed Dec 21, 2024
1 parent 3e89229 commit 2a0b91a
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 4 deletions.
6 changes: 3 additions & 3 deletions bin/scripts/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ export default async () => {

if (project_path) {
project_path = './' + project_path
.replace(/^[\/\.]+/, '')
.replace(/\/+$/, '');
.replace(/^[\/\.\\]+/, '')
.replace(/(\/|\\)+$/, '');
} else {
project_path = '.';
}
Expand All @@ -58,7 +58,7 @@ export default async () => {
for (const file of files) {
const stat = await fs.stat(file);
const is_dir = stat.isDirectory();
const filename = file.split('/').slice(-1)[0];
const filename = file.split(path.sep).slice(-1)[0];

if (ignore.includes(filename)) {
continue;
Expand Down
27 changes: 27 additions & 0 deletions docs/docs/modules/console.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
sidebar_position: 3
---

# console

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.

## concept

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.

## file structure

a console script looks like this:

```js title="console/sample.js"
export default new class {

async run() {
// do something here
console.log('running console command `sample`');
}

};

```
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@exajs/core",
"type": "module",
"author": "Brian Seymour <@realtux>",
"version": "0.0.16",
"version": "0.0.17",
"description": "modern opinionated node.js framework",
"license": "MIT",
"homepage": "https://github.com/realtux/exa",
Expand Down

0 comments on commit 2a0b91a

Please sign in to comment.