budibase/scripts/removeWorkspaceDependencies.sh

17 lines
630 B
Bash
Raw Normal View History

#!/bin/sh
2023-10-03 11:02:11 +02:00
2023-10-18 16:06:32 +02:00
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"
2023-10-03 11:02:11 +02:00
package_json_path="$1"
2023-10-02 18:18:42 +02:00
2023-10-03 09:34:35 +02:00
process_package() {
pkg_path="$1"
2023-10-02 18:18:42 +02:00
for package_name in $packages_to_remove; do
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
2023-10-13 13:59:42 +02:00
done
2023-10-03 09:34:35 +02:00
}
2023-10-02 18:18:42 +02:00
process_package "$package_json_path"