-
Notifications
You must be signed in to change notification settings - Fork 693
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
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
!*ee.rs |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||||||
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}'" | ||||||
fi | ||||||
done | ||||||
fi |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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