This repository has been archived by the owner on Apr 8, 2024. It is now read-only.
generated from salesforcecli/plugin-template
-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9cabc18
commit 3dd4018
Showing
4 changed files
with
87 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#!/usr/bin/env node | ||
|
||
const { spawn } = require('child_process'); | ||
const { join } = require('path'); | ||
|
||
if (process.env.SFDX_HIDE_RELEASE_NOTES === 'true') process.exit(0); | ||
|
||
const logAndExit = (msg) => { | ||
console.log('NOTE: This error can be ignored in CI and may be silenced in the future'); | ||
console.log('- Set the SFDX_HIDE_RELEASE_NOTES env var to "true" to skip this script\n'); | ||
console.log(msg.toString()); | ||
|
||
process.exit(0); | ||
}; | ||
|
||
var executable = process.platform === 'win32' ? 'run.cmd' : 'run'; | ||
|
||
var cmd = spawn(join(__dirname, '..', 'bin', executable), ['whatsnew', '--hook'], { | ||
stdio: ['ignore', 'inherit', 'pipe'], | ||
timeout: 10000, | ||
}); | ||
|
||
cmd.stderr.on('data', (error) => { | ||
logAndExit(error); | ||
}); | ||
|
||
cmd.on('error', (error) => { | ||
logAndExit(error); | ||
}); | ||
|
||
// 'exit' fires whether or not the stream are finished | ||
cmd.on('exit', (code) => { | ||
process.exit(0); | ||
}); |
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,47 @@ | ||
/* | ||
* Copyright (c) 2021, salesforce.com, inc. | ||
* All rights reserved. | ||
* Licensed under the BSD 3-Clause license. | ||
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause | ||
*/ | ||
|
||
import { join } from 'path'; | ||
import { spawn } from 'child_process'; | ||
import { Hook } from '@oclif/config'; | ||
import { cli } from 'cli-ux'; | ||
|
||
if (process.env.SFDX_HIDE_RELEASE_NOTES === 'true') process.exit(0); | ||
|
||
const logAndExit = (msg: Error): void => { | ||
cli.log('NOTE: This error can be ignored in CI and may be silenced in the future'); | ||
cli.log('- Set the SFDX_HIDE_RELEASE_NOTES env var to "true" to skip this script\n'); | ||
cli.log(msg.toString()); | ||
|
||
process.exit(0); | ||
}; | ||
|
||
const hook: Hook.Update = () => { | ||
// NOTE: This is `sfdx.cmd` here and not `run.cmd` because it gets renamed here: | ||
// https://github.com/salesforcecli/sfdx-cli/blob/4428505ab69aa6e21214dba96557e2ce396a82e0/src/hooks/postupdate.ts#L62 | ||
const executable = process.platform === 'win32' ? 'sfdx.cmd' : 'run'; | ||
|
||
const cmd = spawn(join(__dirname, '..', '..', 'bin', executable), ['whatsnew', '--hook'], { | ||
stdio: ['ignore', 'inherit', 'pipe'], | ||
timeout: 10000, | ||
}); | ||
|
||
cmd.stderr.on('data', (error: Error) => { | ||
logAndExit(error); | ||
}); | ||
|
||
cmd.on('error', (error: Error) => { | ||
logAndExit(error); | ||
}); | ||
|
||
// 'exit' fires whether or not the stream are finished | ||
cmd.on('exit', () => { | ||
process.exit(0); | ||
}); | ||
}; | ||
|
||
export default hook; |
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 |
---|---|---|
|
@@ -1299,7 +1299,7 @@ | |
yeoman-generator "4.0.1" | ||
yosay "^2.0.2" | ||
|
||
"@salesforce/[email protected]": | ||
"@salesforce/plugin-info@^1.1.4": | ||
version "1.1.4" | ||
resolved "https://registry.yarnpkg.com/@salesforce/plugin-info/-/plugin-info-1.1.4.tgz#7ed26d0634f4855f9e0ac506385d9a113d74f595" | ||
integrity sha512-gWKMDg93IihIIyc5trp6TCmxTMfDXujrW4EOkNp7qoy3L8fYMVEr0KXBtwepC6DgKqznZkUnu2QrG4q/b3GQGQ== | ||
|