Skip to content

Commit

Permalink
chore: Add rules for automatic rebasing
Browse files Browse the repository at this point in the history
Signed-off-by: Roman Nikitenko <[email protected]>

rh-pre-commit.version: 2.2.0
rh-pre-commit.check-secrets: ENABLED
  • Loading branch information
RomanNikitenko committed Dec 25, 2024
1 parent 312cd2f commit 428caea
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .rebase/add/code/extensions/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"devDependencies": {
"crypto": "1.0.1"
}
}
19 changes: 19 additions & 0 deletions rebase.sh
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,21 @@ apply_package_changes_by_path() {
git add $filePath > /dev/null 2>&1
}

# Apply changes on code/extensions/package.json file
apply_code_extensions_package_lock_changes() {

echo " ⚙️ reworking code/extensions/package-lock.json..."

# reset the file from what is upstream
git checkout --theirs code/extensions/package-lock.json > /dev/null 2>&1

# update package-lock.json
npm install --ignore-scripts --prefix code/extensions

# resolve the change
git add code/extensions/package-lock.json > /dev/null 2>&1
}

# Apply changes on code/remote/package-lock.json file
apply_code_remote_package_lock_changes() {

Expand Down Expand Up @@ -357,6 +372,10 @@ resolve_conflicts() {
echo " ➡️ Analyzing conflict for $conflictingFile"
if [[ "$conflictingFile" == "code/package.json" ]]; then
apply_code_package_changes
elif [[ "$conflictingFile" == "code/extensions/package.json" ]]; then
apply_package_changes_by_path "$conflictingFile"
elif [[ "$conflictingFile" == "code/extensions/package-lock.json" ]]; then
apply_code_extensions_package_lock_changes
elif [[ "$conflictingFile" == "code/product.json" ]]; then
apply_code_product_changes
elif [[ "$conflictingFile" == "code/build/lib/mangle/index.js" ]]; then
Expand Down

0 comments on commit 428caea

Please sign in to comment.