|
| 1 | +#!/bin/bash |
| 2 | +# this is to replace sagemaker unfied studio jupyter scheduler label from "Job" to "Scheudule" to align with overall experience |
| 3 | +set -ex |
| 4 | + |
| 5 | +BASE_PATH="/opt/conda/share/jupyter/labextensions/@jupyterlab/scheduler/static" |
| 6 | + |
| 7 | +# Function to perform replacement |
| 8 | +replace_string() { |
| 9 | + local search="$1" |
| 10 | + local replace="$2" |
| 11 | + echo "Replacing '$search' with '$replace'..." |
| 12 | + grep -l -i -r "$search" "$BASE_PATH" | xargs sed -i "s/$search/$replace/gI" |
| 13 | +} |
| 14 | + |
| 15 | +# List of replacements |
| 16 | +replace_string "\"Schedule\"" "\" \"" |
| 17 | +replace_string "Create Job\"" "Create Schedule\"" |
| 18 | +replace_string "Job name\"" "Schedule name\"" |
| 19 | +replace_string "Run job with input folder\"" "Run schedule with input folder\"" |
| 20 | +replace_string "\"The scheduled job will have access to all files under" "\"The schedule will have access to all files under" |
| 21 | +replace_string "Notebook Jobs\"" "Notebook Schedules\"" |
| 22 | +replace_string "Notebook Job Definitions\"" "Notebook Schedule Definitions\"" |
| 23 | +replace_string "job definitions" "schedule definitions" |
| 24 | +replace_string "Create Notebook Job" "Create Notebook Schedule" |
| 25 | +replace_string "notebook job definition" "notebook schedule definition" |
| 26 | +replace_string "Job definition name" "Schedule definition name" |
| 27 | +replace_string "Job Detail\"" "Schedule Detail\"" |
| 28 | +replace_string "Job ID\"" "Schedule ID\"" |
| 29 | +replace_string "Your job definition" "Your schedule definition" |
| 30 | +replace_string "Your job" "Your schedule" |
| 31 | +replace_string "Job Definition\"" "Schedule Definition\"" |
| 32 | +replace_string "Run Job\"" "Run Schedule\"" |
| 33 | +replace_string "Creating job" "Creating schedule" |
| 34 | +replace_string "Reload Job\"" "Reload Schedule\"" |
| 35 | +replace_string "Delete Job\"" "Delete Schedule\"" |
| 36 | +replace_string "Download Job Files\"" "Download Schedule Files\"" |
| 37 | +replace_string "No notebook jobs associated with this job definition" "No notebook schedules associated with this schedule definition" |
| 38 | +replace_string "Create Job from Schedule Definition\"" "Create Schedule from Schedule Definition\"" |
| 39 | +replace_string "Job definition ID\"" "Schedule definition ID\"" |
| 40 | +replace_string "Create a notebook job" "Create a notebook schedule" |
| 41 | + |
| 42 | +echo "All replacements completed!" |
0 commit comments