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