Merge branch 'master' into isolated-vm

This commit is contained in:
Adria Navarro 2024-01-16 15:42:21 +01:00 committed by GitHub
commit 8b30b89fe1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 14 deletions

View File

@ -3,26 +3,14 @@
packages_to_remove="@budibase/backend-core @budibase/bbui @budibase/builder @budibase/cli @budibase/client @budibase/frontend-core @budibase/pro @budibase/sdk @budibase/server @budibase/shared-core @budibase/string-templates @budibase/types @budibase/worker"
package_json_path="$1"
package_json=$(cat "$package_json_path")
process_package() {
pkg_path="$1"
package_json=$(cat "$pkg_path")
has_changes=false
for package_name in $packages_to_remove; do
if echo "$package_json" | jq -e --arg package_name "$package_name" '.dependencies | has($package_name)' > /dev/null; then
package_json=$(echo "$package_json" | jq "del(.dependencies[\"$package_name\"])")
has_changes=true
fi
jq "del(.dependencies[\"$package_name\"])" $pkg_path > tmp_file.json && mv tmp_file.json $pkg_path
jq "del(.resolutions[\"$package_name\"])" $pkg_path > tmp_file.json && mv tmp_file.json $pkg_path
done
if [ "$has_changes" = true ]; then
echo "$package_json" > "$pkg_path"
fi
}
process_package "$package_json_path"
package_json=$(cat "$package_json_path")
echo "$package_json" | jq "del(.resolutions)" > "$1"