-
Notifications
You must be signed in to change notification settings - Fork 732
Move ee files from OSS to private repo script #5858
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
@@ -5,6 +5,7 @@ root_dirpath="$(cd "${script_dirpath}/.." && pwd)" | |||||||||
|
||||||||||
REVERT="NO" | ||||||||||
COPY="NO" | ||||||||||
MOVE_NEW_FILES="NO" | ||||||||||
EE_CODE_DIR="../windmill-ee-private/" | ||||||||||
|
||||||||||
while [[ $# -gt 0 ]]; do | ||||||||||
|
@@ -15,6 +16,7 @@ while [[ $# -gt 0 ]]; do | |||||||||
# this to work (commit hooks should prevent this from happening, as well as the fact | ||||||||||
# that we're using symlinks by default). | ||||||||||
REVERT="YES" | ||||||||||
MOVE_NEW_FILES="YES" | ||||||||||
shift | ||||||||||
;; | ||||||||||
-c|--copy) | ||||||||||
|
@@ -25,6 +27,11 @@ while [[ $# -gt 0 ]]; do | |||||||||
COPY="YES" | ||||||||||
shift # past argument | ||||||||||
;; | ||||||||||
-m|--move-new-files) | ||||||||||
# This moves all new EE files from the public repository to the private repository. | ||||||||||
MOVE_NEW_FILES="YES" | ||||||||||
shift # past argument | ||||||||||
;; | ||||||||||
-d|--dir) | ||||||||||
# Path to the local directory of the windmill-ee-private repository. By defaults, it | ||||||||||
# assumes it is cloned next to the Windmill OSS repo. | ||||||||||
|
@@ -64,7 +71,7 @@ if [ "$REVERT" == "YES" ]; then | |||||||||
ce_file="${root_dirpath}/backend/${ce_file}" | ||||||||||
rm ${ce_file} | ||||||||||
done | ||||||||||
else | ||||||||||
elif [ "$MOVE_NEW_FILES" == "NO" ]; then | ||||||||||
# This replaces all files in current repo with alternative EE files in windmill-ee-private | ||||||||||
for ee_file in $(find "${EE_CODE_DIR}" -name "*ee.rs"); do | ||||||||||
ce_file="${ee_file/${EE_CODE_DIR}/}" | ||||||||||
|
@@ -78,3 +85,18 @@ else | |||||||||
fi | ||||||||||
done | ||||||||||
fi | ||||||||||
|
||||||||||
if [ "$MOVE_NEW_FILES" == "YES" ]; then | ||||||||||
for ce_file in $(find "${root_dirpath}"/backend/windmill-*/src/ -name "*ee.rs"); do | ||||||||||
backend_dirpath="${root_dirpath}/backend/" | ||||||||||
ee_file="${ce_file/${backend_dirpath}/}" | ||||||||||
ee_file="${EE_CODE_DIR}${ee_file}" | ||||||||||
if [ ! -f "${ee_file}" ]; then\ | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There's a trailing backslash at the end of this condition that should be removed: if [ ! -f "${ee_file}" ]; then\ Should be: if [ ! -f "${ee_file}" ]; then The backslash is typically used for line continuation in shell scripts, but it's unnecessary here and could cause syntax errors since the line already ends with a complete shell construct.
Suggested change
Spotted by Diamond There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove the stray backslash at the end of the if condition to prevent syntax errors.
Suggested change
|
||||||||||
mv "${ce_file}" "${ee_file}" | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ensure the target directory for the moved file exists (e.g., use
Suggested change
|
||||||||||
if [ ! "$REVERT" == "YES" ]; then | ||||||||||
ln -s "${ee_file}" "${ce_file}" | ||||||||||
fi | ||||||||||
echo "File moved '${ce_file} -->> '${ee_file}'" | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fix the echo quoting; likely intended to be:
Suggested change
|
||||||||||
fi | ||||||||||
done | ||||||||||
fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It appears that the
-r|--revert
case automatically setsMOVE_NEW_FILES="YES"
, which doesn't align with the expected behavior. This forces the move functionality to run whenever reverting, even if not explicitly requested. Consider removing this line to keep the revert functionality focused on its primary purpose, allowing users to explicitly combine flags when needed.Spotted by Diamond
Is this helpful? React 👍 or 👎 to let us know.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
intended