dgrove-oss commented on code in PR #191:
URL: 
https://github.com/apache/openwhisk-runtime-go/pull/191#discussion_r1156338226


##########
openwhisk/filetype.go:
##########
@@ -65,3 +65,13 @@ func IsZip(buf []byte) bool {
                (buf[2] == 0x3 || buf[2] == 0x5 || buf[2] == 0x7) &&
                (buf[3] == 0x4 || buf[3] == 0x6 || buf[3] == 0x8)
 }
+
+// IsTarGz checks if the given file is a valid tar.gz file
+func IsTarGz(buf []byte) bool {

Review Comment:
   I think this is only checking for a gzip file.  Is there a check for tar 
format too?  or should the name of the function be changed to`isGz` 



##########
openwhisk/extractor.go:
##########
@@ -64,6 +64,17 @@ func (ap *ActionProxy) ExtractAction(buf *[]byte, suffix 
string) (string, error)
                }
                Debug("Extract Action, assuming a zip")
                return file, Unzip(*buf, newDir)
+
+       } else if IsTarGz(*buf) {
+               jar := os.Getenv("OW_SAVE_JAR")
+               if jar != "" {
+                       jarFile := newDir + "/" + jar
+                       Debug("Extract Action, checking if it is a jar first")
+                       return jarFile, UnzipOrSaveJar(*buf, newDir, jarFile)
+               }
+
+               Debug("Extract Action, assuming a zip")

Review Comment:
   ```suggestion
                Debug("Extract Action, assuming a tar.gz")
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to