-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge changes published in the Gutenberg plugin "release/7.9" branch
- Loading branch information
Showing
843 changed files
with
28,260 additions
and
13,990 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
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,43 @@ | ||
#!/usr/bin/env node | ||
|
||
/** | ||
* Node dependencies. | ||
*/ | ||
const { extname } = require( 'path' ); | ||
const chalk = require( 'chalk' ); | ||
const execSync = require( 'child_process' ).execSync; | ||
const { readFile } = require( 'fs' ).promises; | ||
|
||
const getUnstagedFiles = () => | ||
execSync( 'git diff --name-only', { encoding: 'utf8' } ) | ||
.split( '\n' ) | ||
.filter( Boolean ); | ||
|
||
const fileHasToken = async ( file ) => | ||
( await readFile( file, 'utf8' ) ).includes( '<!-- START TOKEN' ); | ||
|
||
const getUnstagedReadmes = () => | ||
Promise.all( | ||
getUnstagedFiles().map( | ||
async ( file ) => | ||
extname( file ) === '.md' && | ||
( await fileHasToken( file ) ) && | ||
file | ||
) | ||
).then( ( files ) => files.filter( Boolean ) ); | ||
|
||
( async () => { | ||
const unstagedReadmes = await getUnstagedReadmes(); | ||
if ( unstagedReadmes.length > 0 ) { | ||
process.exitCode = 1; | ||
process.stdout.write( | ||
chalk.red( | ||
'\n', | ||
'Some API docs may be out of date:', | ||
unstagedReadmes.toString(), | ||
'Either stage them or continue with --no-verify.', | ||
'\n' | ||
) | ||
); | ||
} | ||
} )(); |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.