brooklyn-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aledsage <...@git.apache.org>
Subject [GitHub] incubator-brooklyn pull request: Change version only on the line f...
Date Thu, 04 Jun 2015 12:51:47 GMT
Github user aledsage commented on a diff in the pull request:

    https://github.com/apache/incubator-brooklyn/pull/678#discussion_r31716722
  
    --- Diff: usage/scripts/change-version.sh ---
    @@ -63,7 +63,7 @@ FILES_COUNT=`echo $FILES | wc | awk '{print $2}'`
     if [ ${FILES_COUNT} -ne 0 ]; then
         # search for files containing version markers
         sed -i.bak -e "/${VERSION_MARKER}/s/${CURRENT_VERSION}/${NEW_VERSION}/g" $FILES
    -    sed -i.bak -e "/${VERSION_MARKER_NL}/n;s/${CURRENT_VERSION}/${NEW_VERSION}/g" $FILES
    +    sed -i.bak -e "/${VERSION_MARKER_NL}/{n;s/${CURRENT_VERSION}/${NEW_VERSION}/g;}"
$FILES
    --- End diff --
    
    I'm not sure if this is working.
    
    I created a test file:
    
    ```
    1.2.0-SNAPSHOT # MY_VERSION
    
    some text
    
    1.2.0-SNAPSHOT
    
    some more text
    
    # MY_VERSION
    1.2.0-SNAPSHOT
    
    blah
    
    1.2.0-SNAPSHOT
    # MY_VERSION
    ```
    
    And I ran `$BROOKLYN_REPO/usage/scripts/change-version.sh MY 1.2.0-SNAPSHOT 1.2.0-CHANGED`.
    
    The output file was:
    
    ```
    1.2.0-CHANGED # MY_VERSION
    
    some text
    
    1.2.0-SNAPSHOT
    
    some more text
    
    # MY_VERSION
    1.2.0-SNAPSHOT
    
    blah
    
    1.2.0-SNAPSHOT
    # MY_VERSION
    ```
    
    i.e. it didn't change it on the line after "# MY_VERSION".


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message