+
Skip to content

Address a bug processing the config file in Linux #118

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion node/binary.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,9 @@ function install() {
}

function uninstall() {
getBinary(getSupportedPlatform()).uninstall();
supportedPlatforms.forEach((platform) => {
getBinary(platform).uninstall();
});
}

module.exports = {
Expand Down
1 change: 0 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -264,8 +264,7 @@
"compile": "webpack",
"watch": "webpack --watch",
"package": "webpack --mode production --devtool hidden-source-map",
"postinstall": "node ./node/binaryInstall.js",
"prepare": "husky install",
"perepare": "node ./node/binaryInstall.js; husky install",
"preuninstall": "node ./node/binaryUninstall.js",
"test-compile": "tsc -p ./",
"test-watch": "tsc -watch -p ./",
Expand Down
30 changes: 14 additions & 16 deletions src/utils/getProcessedConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,19 @@ import * as cp from 'child_process';
import { getBinaryPath } from '../../node/binary.js';
import getSpawnOptions from './getSpawnOptions';

// Gets the plain text of the processed .circleci/config.yml file.
// The CircleCI CLI binary compiles that .yml file into another .yml file.
// For example, it copies orbs into the file and evaluates the job parameters.
/**
* Gets the contents of the processed .circleci/config.yml file.
*
* The CircleCI CLI binary compiles that .yml file into another .yml file.
* For example, it copies orbs into the file and evaluates the job parameters.
*/
export default function getProcessedConfig(configFilePath: string): string {
const { stdout, stderr } = cp.spawnSync(
getBinaryPath(),
['config', 'process', configFilePath],
getSpawnOptions()
);

if (!stdout?.length) {
throw new Error(
stderr?.length ? stderr.toString() : 'Failed to process the config'
);
}

return stdout.toString().trim();
return cp
.execFileSync(
getBinaryPath(),
['config', 'process', configFilePath],
getSpawnOptions()
)
.toString()
.trim();
}
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载