Skip to content

[ci] Adding bourne shell compatibility test#2187

Merged
bimbashrestha merged 5 commits intofacebook:devfrom
bimbashrestha:bourne
Jun 2, 2020
Merged

[ci] Adding bourne shell compatibility test#2187
bimbashrestha merged 5 commits intofacebook:devfrom
bimbashrestha:bourne

Conversation

@bimbashrestha
Copy link
Contributor

Closes #2149

I'm using shellcheck to check compatibility with bourne shell explicitly. I confirmed that this catches the incompatibility that was missed in the previous release (#2148):

In tests/playTests.sh line 270:
if [[ $file2timestamp -ge $file1timestamp ]]; then
   ^-- SC2039: In POSIX sh, [[ ]] is undefined.

It also discovered 3 other warnings. Two of them were good suggestions so I fixed them. One of them isn't worth fixing imo so I suppressed it using shellcheck --exclude. This is the warning I excluded

In tests/playTests.sh line 401:
    ls -las $INTOVOID | grep "rw-rw-rw-"
    ^-- SC2010: Don't use ls | grep. Use a glob or a for loop with a condition to allow non-alphanumeric filenames.

@Cyan4973
Copy link
Contributor

Cyan4973 commented Jun 2, 2020

Excellent ! Thanks @bimbashrestha !

@bimbashrestha bimbashrestha merged commit 448658a into facebook:dev Jun 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Test Shell Script Portability Better

3 participants