-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update payload-reducer@0.0.0 to graph-reducer@0.1.1, due to the bug i…
…n v0.0.0
- Loading branch information
1 parent
a527451
commit 70b080f
Showing
7 changed files
with
50 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import fs from 'fs/promises' | ||
import path, {sep} from 'path' | ||
import packageJson from './package.json' // `node --experimental-json-modules` | ||
// // https://nodejs.org/api/esm.html#esm_no_json_module_loading | ||
|
||
/** | ||
* Created on 1399/9/27 (2020/12/17). | ||
* Thank https://stackoverflow.com/a/64255382/5318303 | ||
* @author {@link https://mirismaili.github.io S. Mahdi Mir-Ismaili} | ||
*/ | ||
|
||
async function copyDir(src, dest) { | ||
const entries = await fs.readdir(src, {withFileTypes: true}) | ||
|
||
console.group(`${src}${sep} ==> ${dest}${sep}`) | ||
{ | ||
for (const entry of entries) { | ||
const srcPath = path.join(src, entry.name) | ||
const destPath = path.join(dest, entry.name) | ||
|
||
entry.isDirectory() ? | ||
await copyDir(srcPath, destPath) : | ||
await fs.copyFile(srcPath, destPath).then(() => console.log(`${srcPath} --> ${destPath}`)) | ||
} | ||
} | ||
console.groupEnd() | ||
} | ||
|
||
for (const projectPath of process.env.CONSUMER_PROJECT_PATH.split(',')) { | ||
const dest = path.join(projectPath, 'node_modules', packageJson.name, 'dist') | ||
|
||
if (!(await fs.stat(dest)).isDirectory()) { | ||
console.error('The path is not a directory:', dest) | ||
continue | ||
} | ||
|
||
await copyDir('dist', dest).catch(console.error.bind(console)) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
xcopy /y dist ^ | ||
<PROJECT-PATH>\node_modules\@rahazad\roudex\dist\ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters