Skip to content
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

Make Che Theia release script passing ShellCheck #16652

Closed
azatsarynnyy opened this issue Apr 17, 2020 · 0 comments · Fixed by eclipse-che/che-theia#764
Closed

Make Che Theia release script passing ShellCheck #16652

azatsarynnyy opened this issue Apr 17, 2020 · 0 comments · Fixed by eclipse-che/che-theia#764
Labels
area/editor/theia Issues related to the che-theia IDE of Che good first issue Community, this issue looks easy to start with for a new contributor. Just take it. We'll help you! kind/task Internal things, technical debt, and to-do tasks to be performed. severity/P2 Has a minor but important impact to the usage or development of the system.

Comments

@azatsarynnyy
Copy link
Member

Is your task related to a problem? Please describe.

It would be great to make Che Theia release script passing ShellCheck.

Describe the solution you'd like

Describe alternatives you've considered

Additional context

result of static analysis
$ shellcheck myscript
 
Line 69:
  read THEIA_VERSION < THEIA_VERSION
  ^-- SC2162: read without -r will mangle backslashes.
       ^-- SC2094: Make sure not to read and write the same file in the same pipeline.
                       ^-- SC2094: Make sure not to read and write the same file in the same pipeline.
 
Line 92:
      -e 's/THEIA_VERSION="..*"/THEIA_VERSION="'${THEIA_PATCHES_DIR}'"/' \
                                                ^-- SC2086: Double quote to prevent globbing and word splitting.

Did you mean: (apply this, apply all SC2086)
      -e 's/THEIA_VERSION="..*"/THEIA_VERSION="'"${THEIA_PATCHES_DIR}"'"/' \
 
Line 93:
      -e 's/THEIA_BRANCH="..*"/THEIA_BRANCH="'${THEIA_BRANCH}'"/' \
                                              ^-- SC2086: Double quote to prevent globbing and word splitting.

Did you mean: (apply this, apply all SC2086)
      -e 's/THEIA_BRANCH="..*"/THEIA_BRANCH="'"${THEIA_BRANCH}"'"/' \
 
Line 94:
      -e 's#THEIA_GIT_REFS="..*"#THEIA_GIT_REFS="'${THEIA_GIT_REFS}'"#' \
                                                  ^-- SC2086: Double quote to prevent globbing and word splitting.

Did you mean: (apply this, apply all SC2086)
      -e 's#THEIA_GIT_REFS="..*"#THEIA_GIT_REFS="'"${THEIA_GIT_REFS}"'"#' \
 
Line 95:
      -e 's/THEIA_DOCKER_IMAGE_VERSION=.*/THEIA_DOCKER_IMAGE_VERSION="'${VERSION}'"/'
>>                                                                     ^-- SC2086: Double quote to prevent globbing and word splitting.

Did you mean: (apply this, apply all SC2086)
      -e 's/THEIA_DOCKER_IMAGE_VERSION=.*/THEIA_DOCKER_IMAGE_VERSION="'"${VERSION}"'"/'
 
Line 102:
    sed -i ./${m}/package.json \
             ^-- SC2086: Double quote to prevent globbing and word splitting.

Did you mean: (apply this, apply all SC2086)
    sed -i ./"${m}"/package.json \
 
Line 103:
        -r -e 's/("version": )(".*")/\1"'$VERSION'"/' \
                                         ^-- SC2086: Double quote to prevent globbing and word splitting.

Did you mean: (apply this, apply all SC2086)
        -r -e 's/("version": )(".*")/\1"'"$VERSION"'"/' \
 
Line 104:
        -r -e '/plugin-packager/!s/("@theia\/..*": )(".*")/\1"'${THEIA_VERSION}'"/' \
>>                                                             ^-- SC2086: Double quote to prevent globbing and word splitting.

Did you mean: (apply this, apply all SC2086)
        -r -e '/plugin-packager/!s/("@theia\/..*": )(".*")/\1"'"${THEIA_VERSION}"'"/' \
 
Line 105:
        -r -e '/@eclipse-che\/api|@eclipse-che\/workspace-client|@eclipse-che\/workspace-telemetry-client/!s/("@eclipse-che\/..*": )(".*")/\1"'$VERSION'"/'
>>                                                                                                                                             ^-- SC2086: Double quote to prevent globbing and word splitting.

Did you mean: (apply this, apply all SC2086)
        -r -e '/@eclipse-che\/api|@eclipse-che\/workspace-client|@eclipse-che\/workspace-telemetry-client/!s/("@eclipse-che\/..*": )(".*")/\1"'"$VERSION"'"/'
 
Line 116:
            -e '/RUN git clone/s#$# \&\& cd ${HOME}/theia-source-code \&\& git checkout '${THEIA_COMMIT_SHA}'#'
               ^-- SC2016: Expressions don't expand in single quotes, use double quotes for that.
>>                                                                                       ^-- SC2086: Double quote to prevent globbing and word splitting.

Did you mean: (apply this, apply all SC2086)
            -e '/RUN git clone/s#$# \&\& cd ${HOME}/theia-source-code \&\& git checkout '"${THEIA_COMMIT_SHA}"'#'
 
Line 120:
          -e '/RUN git clone/s#$# \&\& cd ${HOME} \&\& tar zcf ${HOME}/theia-source-code.tgz theia-source-code#'
             ^-- SC2016: Expressions don't expand in single quotes, use double quotes for that.
 
Line 126:
          -r -e 's/( git checkout )(.*)/\1'${THEIA_COMMIT_SHA}'/'
                                           ^-- SC2086: Double quote to prevent globbing and word splitting.

Did you mean: (apply this, apply all SC2086)
          -r -e 's/( git checkout )(.*)/\1'"${THEIA_COMMIT_SHA}"'/'
 
Line 128:
          -r -e 's/( git checkout )(.*)( \&\& cd )/\1'${THEIA_COMMIT_SHA}'\3/'
                                                      ^-- SC2086: Double quote to prevent globbing and word splitting.

Did you mean: (apply this, apply all SC2086)
          -r -e 's/( git checkout )(.*)( \&\& cd )/\1'"${THEIA_COMMIT_SHA}"'\3/'

$
@azatsarynnyy azatsarynnyy added the kind/task Internal things, technical debt, and to-do tasks to be performed. label Apr 17, 2020
@che-bot che-bot added the status/need-triage An issue that needs to be prioritized by the curator responsible for the triage. See https://github. label Apr 17, 2020
@azatsarynnyy azatsarynnyy added good first issue Community, this issue looks easy to start with for a new contributor. Just take it. We'll help you! severity/P2 Has a minor but important impact to the usage or development of the system. labels Apr 17, 2020
@sleshchenko sleshchenko added area/editor/theia Issues related to the che-theia IDE of Che and removed status/need-triage An issue that needs to be prioritized by the curator responsible for the triage. See https://github. labels Apr 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/editor/theia Issues related to the che-theia IDE of Che good first issue Community, this issue looks easy to start with for a new contributor. Just take it. We'll help you! kind/task Internal things, technical debt, and to-do tasks to be performed. severity/P2 Has a minor but important impact to the usage or development of the system.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants