Conversation
Codecov Report
@@ Coverage Diff @@
## develop #32 +/- ##
========================================
Coverage 80.15% 80.15%
========================================
Files 2 2
Lines 131 131
========================================
Hits 105 105
Misses 26 26
Continue to review full report at Codecov.
|
djones6
left a comment
There was a problem hiding this comment.
Please also rebase this branch on develop to get rid of the spurious merge commit from master
ci/update.sh
Outdated
| git checkout pod | ||
| git pull origin master | ||
|
|
||
| DIR=$(pwd) |
There was a problem hiding this comment.
This should be the first line of the script (other than perhaps a comment block that says what this script is for). In case, for example, one of the other commands changed the pwd.
I'd also suggest a comment explaining what the variable is (ie. 'The root of the project directory') and giving it a more descriptive name eg. projectDir
ci/update.sh
Outdated
| @@ -75,7 +77,7 @@ cd ../SwiftyRequest* | |||
| rm -rf ../../../Sources/KituraKit/SwiftyRequest | |||
| cp -r Sources/SwiftyRequest ../../../Sources/KituraKit | |||
There was a problem hiding this comment.
These shouldn't be relative paths, they should be using $projectDir (see comment on naming above)
ci/update.sh
Outdated
| cd $DIR/Sources/KituraKit | ||
|
|
||
| # Remove all the import statements that aren't needed | ||
| read -a SWIFTFILES <<< $(find .. -name "*.swift") |
There was a problem hiding this comment.
This should be find $projectDir/Sources, and you can get rid of the cd above altogether
ci/update.sh
Outdated
| cd $DIR | ||
|
|
||
| rm -rf swift-4.0-RELEASE-ubuntu14.04/ | ||
| rm -rf Package-Builder/ |
There was a problem hiding this comment.
similarly you can get rid of the cd and pass an absolute path to rm
|
Addressed all review comments. |
djones6
left a comment
There was a problem hiding this comment.
Some more instances of cd and ..
ci/update.sh
Outdated
| @@ -59,26 +62,25 @@ git pull origin master | |||
| swift package resolve | |||
|
|
|||
| cd .build/checkouts/LoggerAPI* | |||
ci/update.sh
Outdated
| rm -rf $projectDir/Sources/KituraKit/LoggerAPI | ||
| cp -r Sources/LoggerAPI $projectDir/Sources/KituraKit | ||
|
|
||
| cd ../CircuitBreaker* |
ci/update.sh
Outdated
| rm -rf $projectDir/Sources/KituraKit/CircuitBreaker | ||
| cp -r Sources/CircuitBreaker $projectDir/Sources/KituraKit | ||
|
|
||
| cd ../KituraContracts* |
ci/update.sh
Outdated
| cp -r Sources/KituraContracts $projectDir/Sources/KituraKit | ||
| mv $projectDir/Sources/KituraKit/KituraContracts/CodableQuery/*.swift $projectDir/Sources/KituraKit/KituraContracts/ | ||
|
|
||
| cd ../SwiftyRequest* |
ci/update.sh
Outdated
| rm -rf ../../../Sources/KituraKit/LoggerAPI | ||
| cp -r Sources/LoggerAPI ../../../Sources/KituraKit | ||
| rm -rf $projectDir/Sources/KituraKit/LoggerAPI | ||
| cp -r Sources/LoggerAPI $projectDir/Sources/KituraKit |
There was a problem hiding this comment.
rather than the cd above, I believe this could be accomplished with
cp -r $projectDir/.build/checkouts/LoggerAPI*/Sources/LoggerAPI $projectDir/Sources/KituraKit
|
After discussion, the suggestion above doesn't work (apparently, can't have a wildcard in the middle of a file path). An alternative that still avoids By adding the and ( A slower (but safer) approach would be: The location of the edited package is something we can rely on and since it has a predictable name, doesn't require the wildcard stuff above. |
ci/update.sh
Outdated
| rm -rf ../../../Sources/KituraKit/CircuitBreaker | ||
| cp -r Sources/CircuitBreaker ../../../Sources/KituraKit | ||
| rm -rf $projectDir/Sources/KituraKit/CircuitBreaker | ||
| cd .build/checkouts/CircuitBreaker* && cp -r Sources/CircuitBreaker $projectDir/Sources/KituraKit |
There was a problem hiding this comment.
No good - you are cding to another location above but not returning to $projectDir before executing the next cd to a relative location.
You could fix this by prepending $projectDir to each cd, but then the git commands at the end would fail (you'd need a final cd $projectDir before them).
I'd recommend the cd-less approach I suggested in my earlier review (using swift package edit) as you can then stay at the project root for the duration of the script.
|
@djones6 Ready for a fresh review. Thanks for the suggestion 👍 |
This PR is to remove changing directories via relative paths.
Instead we store the root directory of the project in a variable, and use the absolute path of the stored
pwd