-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[meta] Make
copy-metafiles
platform-independent
Co-authored-by: Manuel Thalmann <m@nuth.ch> Co-authored-by: Jordan Harband <ljharb@gmail.com>
- Loading branch information
Showing
5 changed files
with
51 additions
and
2 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import path from 'path' | ||
import copyFileSync from 'fs-copy-file-sync' | ||
import resolverDirectories from './resolverDirectories' | ||
|
||
let files = [ | ||
'LICENSE', | ||
'.npmrc', | ||
] | ||
|
||
let directories = [ | ||
'memo-parser', | ||
...resolverDirectories, | ||
'utils', | ||
] | ||
|
||
for (let directory of directories) { | ||
for (let file of files) { | ||
let destination = path.join(directory, file) | ||
copyFileSync(file, destination) | ||
console.log(`${file} -> ${destination}`) | ||
} | ||
} |
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,3 @@ | ||
import glob from 'glob' | ||
|
||
export default glob.sync('./resolvers/*/') |
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,20 @@ | ||
import { spawnSync } from 'child_process' | ||
import npmWhich from 'npm-which' | ||
import resolverDirectories from './resolverDirectories' | ||
|
||
let npmPath = npmWhich(__dirname).sync('npm') | ||
let spawnOptions = { | ||
stdio: 'inherit', | ||
} | ||
|
||
spawnSync( | ||
npmPath, | ||
['test'], | ||
Object.assign({ cwd: __dirname }, spawnOptions)) | ||
|
||
for (let resolverDir of resolverDirectories) { | ||
spawnSync( | ||
npmPath, | ||
['test'], | ||
Object.assign({ cwd: resolverDir }, spawnOptions)) | ||
} |