mirror of
https://github.com/shivammathur/setup-php.git
synced 2024-11-26 13:23:05 +07:00
Fix macos
This commit is contained in:
parent
c596331f84
commit
c188004a52
@ -42,11 +42,12 @@ describe('Utils tests', () => {
|
||||
it('checking asyncForEach', async () => {
|
||||
const array: Array<string> = ['a', 'b', 'c'];
|
||||
let concat = '';
|
||||
await utils.asyncForEach(array, async function (
|
||||
str: string
|
||||
): Promise<void> {
|
||||
await utils.asyncForEach(
|
||||
array,
|
||||
async function (str: string): Promise<void> {
|
||||
concat += str;
|
||||
});
|
||||
}
|
||||
);
|
||||
expect(concat).toBe('abc');
|
||||
});
|
||||
|
||||
@ -83,12 +84,12 @@ describe('Utils tests', () => {
|
||||
const runner_dir: string = process.env['RUNNER_TOOL_CACHE'] || '';
|
||||
const script_path: string = path.join(runner_dir, 'test.sh');
|
||||
await utils.writeScript('test.sh', testString);
|
||||
await fs.readFile(script_path, function (
|
||||
error: Error | null,
|
||||
data: Buffer
|
||||
) {
|
||||
await fs.readFile(
|
||||
script_path,
|
||||
function (error: Error | null, data: Buffer) {
|
||||
expect(testString).toBe(data.toString());
|
||||
});
|
||||
}
|
||||
);
|
||||
await cleanup(script_path);
|
||||
});
|
||||
|
||||
|
@ -271,10 +271,10 @@ setup_php() {
|
||||
export HOMEBREW_NO_INSTALL_CLEANUP=TRUE
|
||||
brew tap --shallow shivammathur/homebrew-php
|
||||
update_dependencies
|
||||
if brew list php@"$version" 2>/dev/null | grep -q "Error" && [ "$action" != "upgrade" ]; then
|
||||
brew unlink php@"$version"
|
||||
if ! [[ "$(find "$(brew --cellar)"/php/ -maxdepth 1 -name "$version*" | wc -l 2>/dev/null)" -eq 0 ]] && [ "$action" != "upgrade" ]; then
|
||||
brew unlink shivammathur/php/php@"$version"
|
||||
else
|
||||
brew "$action" shivammathur/php/php@"$version"
|
||||
brew upgrade "shivammathur/php/php@$version" 2>/dev/null || brew install "shivammathur/php/php@$version"
|
||||
fi
|
||||
brew link --force --overwrite php@"$version"
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user