init
This commit is contained in:
parent
b2a4a8a1f6
commit
50792ca5d9
@ -49,31 +49,22 @@ spec:
|
|||||||
script: |
|
script: |
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
set -ex
|
set -ex
|
||||||
|
|
||||||
# Install Nx if missing
|
# Install Nx if missing
|
||||||
command -v nx >/dev/null || npm install -g nx@latest
|
command -v nx >/dev/null || npm install -g nx@latest
|
||||||
|
|
||||||
# Convert parameters to arrays
|
|
||||||
TARGETS=($(echo "$(params.targetProjects)" | tr ' ' '\n'))
|
|
||||||
SOURCES=($(echo "$(params.sourceProjects)" | tr ' ' '\n'))
|
|
||||||
|
|
||||||
if [ ${#TARGETS[@]} -ne ${#SOURCES[@]} ]; then
|
TARGETS="$(params.targetProjects)"
|
||||||
echo "Error: targetProjects and sourceProjects count mismatch"
|
SOURCES="$(params.sourceProjects)"
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Process each project pair
|
set -- $TARGETS
|
||||||
for i in $(seq 0 $((${#TARGETS[@]}-1))); do
|
for TARGET in "$@"; do
|
||||||
SRC="${SOURCES[$i]}"
|
SRC=$(echo "$SOURCES" | cut -d' ' -f1)
|
||||||
TARGET="${TARGETS[$i]}"
|
SOURCES=$(echo "$SOURCES" | cut -s -d' ' -f2-)
|
||||||
|
echo "Importing: $SRC → $TARGET"
|
||||||
echo "Importing: ${SRC} → ${TARGET}"
|
nx import "$SRC" "$TARGET"
|
||||||
# nx import "${SRC}" --destination="${TARGET}" --importPath=$(basename "${TARGET}")
|
|
||||||
nx import "${SRC}" "${TARGET}"
|
|
||||||
|
|
||||||
echo "Updating version to $(params.version)"
|
echo "Updating version to $(params.version)"
|
||||||
sed -i.bak "s/^version = .*/version = \"$(params.version)\"/" "${TARGET}/Cargo.toml"
|
sed -i.bak "s/^version = .*/version = \"$(params.version)\"/" "$TARGET/Cargo.toml"
|
||||||
rm -f "${TARGET}/Cargo.toml.bak"
|
rm -f "$TARGET/Cargo.toml.bak"
|
||||||
done
|
done
|
||||||
|
|
||||||
- name: git-commit
|
- name: git-commit
|
||||||
|
Loading…
x
Reference in New Issue
Block a user