Skip to content

Commit

Permalink
Project update. [p][robotic]
Browse files Browse the repository at this point in the history
  • Loading branch information
jaswrks committed Feb 2, 2023
1 parent 6b823fc commit 643b3c1
Show file tree
Hide file tree
Showing 5 changed files with 128 additions and 123 deletions.
7 changes: 6 additions & 1 deletion dev/.files/bin/update.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -349,19 +349,24 @@ class Projects {

const devFilesDir = path.resolve(projDir, './dev/.files');
const pkgFile = path.resolve(projDir, './package.json');
const madrunFile = path.resolve(projDir, './.madrun.mjs');

/**
* Validates the current glob result.
*/

if (hasAllGlob && !fs.existsSync(devFilesDir)) {
u.log(chalk.gray('Has glob `*`. No `./dev/.files` inside `' + projDisplayDir + '`. Bypassing.'));
u.log(chalk.gray('Has glob `*`. No `./dev/.files` in `' + projDisplayDir + '`. Bypassing.'));
continue; // No `./dev/.files` directory.
}
if (hasAllGlob && !fs.existsSync(pkgFile)) {
u.log(chalk.gray('Has glob `*`. No `./package.json` in `' + projDisplayDir + '`. Bypassing.'));
continue; // No `./package.json` file.
}
if (hasAllGlob && !fs.existsSync(madrunFile)) {
u.log(chalk.gray('Has glob `*`. No `./.madrun.mjs` in `' + projDisplayDir + '`. Bypassing.'));
continue; // No `./.madrun.mjs` file.
}

/**
* Runs CMD(s) for current glob result.
Expand Down
4 changes: 2 additions & 2 deletions dev/.files/docs/usage/bin-scripts/update.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,9 @@ With this structure, all `clevercanyon` projects are together. If you are workin

By default, the glob patterns are `[ '*', '.github' ]`, matching all direct siblings, and also matching one special `.github` directory, if it's present on your system. The special `.github` repository contains our GitHub organization config files.

If any of the glob patterns is set to a single `*` (as in the default case), scripts are only run if the project directory contains a `./dev/.files` directory and a `./package.json` file.
If any of the glob patterns is set to a single `*` (as in the default case), scripts are only run if the project directory contains a `./dev/.files` directory, a `./package.json` file, and a `./.madrun.mjs` file.

However, when the glob pattern is set to something else and doesn’t contain a glob with a single `*`, you must be sure of what you're doing, because the restriction is no longer applied and all scripts and/or custom commands will run as requested with no requirement that a project contain a `./dev/.files` directory or a `./package.json` file. For this reason it is strongly suggested that you do a `--dryRun` and review carefully. Massive productivity can turn into massive cleanup if you're not careful!
However, when the glob pattern is set to something else and doesn’t contain a glob with a single `*`, you must be sure of what you're doing, because the restriction is no longer applied and all scripts and/or custom commands will run as requested with no requirement that a project contain a `./dev/.files` directory, a `./package.json` file, or a `./.madrun.mjs` file. For this reason it is strongly suggested that you do a `--dryRun` and review carefully. Massive productivity can turn into massive cleanup if you're not careful!

<small>_**Note:** All of the examples below end with `--dryRun`. Remove the flag when running for real._</small>

Expand Down
2 changes: 1 addition & 1 deletion dev/.files/madrun/includes/events.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export default {
const parentDirBasename = path.basename(parentDir);

const parentDirBrand = $brand.get(parentDirBasename);
const parentDirOwner = parentDirBrand?.slug || parentDirBasename;
const parentDirOwner = parentDirBrand?.org?.slug || parentDirBasename;

/**
* Updates `./package.json` in new project directory.
Expand Down
Loading

0 comments on commit 643b3c1

Please sign in to comment.