mirror of
https://github.com/alibaba/anyproxy.git
synced 2025-06-06 17:28:21 +00:00
add before_script for CI
This commit is contained in:
parent
7908cbad4f
commit
e89fd54996
@ -3,3 +3,5 @@ node_js:
|
|||||||
- 8
|
- 8
|
||||||
- 10
|
- 10
|
||||||
- 12
|
- 12
|
||||||
|
before_script:
|
||||||
|
- node ./bin/anyproxy-ca -g
|
@ -20,10 +20,10 @@ program
|
|||||||
.parse(process.argv);
|
.parse(process.argv);
|
||||||
|
|
||||||
function openFolderOfFile(filePath) {
|
function openFolderOfFile(filePath) {
|
||||||
const isWin = /^win/.test(process.platform);
|
const platform = process.platform;
|
||||||
if (isWin) {
|
if (/^win/.test(platform)) {
|
||||||
exec('start .', { cwd: path.dirname(filePath) });
|
exec('start .', { cwd: path.dirname(filePath) });
|
||||||
} else {
|
} else if (/darwin/.test(platform)) {
|
||||||
exec(`open -R ${filePath}`);
|
exec(`open -R ${filePath}`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -33,7 +33,6 @@ function guideToGenrateCA() {
|
|||||||
if (!error) {
|
if (!error) {
|
||||||
const certDir = path.dirname(keyPath);
|
const certDir = path.dirname(keyPath);
|
||||||
console.log(`The cert is generated at ${certDir}. Please trust the ${color.bold('rootCA.crt')}.`);
|
console.log(`The cert is generated at ${certDir}. Please trust the ${color.bold('rootCA.crt')}.`);
|
||||||
// TODO: console.log('guide to install');
|
|
||||||
openFolderOfFile(crtPath);
|
openFolderOfFile(crtPath);
|
||||||
} else {
|
} else {
|
||||||
console.error('failed to generate rootCA', error);
|
console.error('failed to generate rootCA', error);
|
||||||
@ -44,7 +43,6 @@ function guideToGenrateCA() {
|
|||||||
function guideToTrustCA() {
|
function guideToTrustCA() {
|
||||||
const certPath = AnyProxy.utils.certMgr.getRootCAFilePath();
|
const certPath = AnyProxy.utils.certMgr.getRootCAFilePath();
|
||||||
if (certPath) {
|
if (certPath) {
|
||||||
// TODO: console.log('guide to install');
|
|
||||||
openFolderOfFile(certPath);
|
openFolderOfFile(certPath);
|
||||||
} else {
|
} else {
|
||||||
console.error('failed to get cert path');
|
console.error('failed to get cert path');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user