Skip to content

Commit

Permalink
Fix macos
Browse files Browse the repository at this point in the history
  • Loading branch information
shivammathur committed Nov 28, 2020
1 parent c596331 commit c188004
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 14 deletions.
23 changes: 12 additions & 11 deletions __tests__/utils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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> {
concat += str;
});
await utils.asyncForEach(
array,
async function (str: string): Promise<void> {
concat += str;
}
);
expect(concat).toBe('abc');
});

Expand Down Expand Up @@ -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
) {
expect(testString).toBe(data.toString());
});
await fs.readFile(
script_path,
function (error: Error | null, data: Buffer) {
expect(testString).toBe(data.toString());
}
);
await cleanup(script_path);
});

Expand Down
6 changes: 3 additions & 3 deletions src/scripts/darwin.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
Expand Down

0 comments on commit c188004

Please sign in to comment.