Skip to content

Commit

Permalink
Merge branch 'master' into 2068_analytics_to_flank_wrapper
Browse files Browse the repository at this point in the history
  • Loading branch information
piotradamczyk5 authored Jul 14, 2021
2 parents dd4020c + f44162e commit e174d3e
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import ftl.api.RemoteStorage
import ftl.api.uploadToRemoteStorage
import ftl.args.AndroidArgs
import ftl.args.IArgs
import ftl.config.FtlConstants.GCS_PREFIX
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.async
import kotlinx.coroutines.awaitAll
Expand All @@ -24,9 +25,9 @@ internal suspend fun AndroidArgs.uploadObbFiles(): Map<String, String> = corouti
}.awaitAll().toMap()
}

fun upload(file: String, rootGcsBucket: String, runGcsPath: String): String {
return uploadToRemoteStorage(
fun upload(file: String, rootGcsBucket: String, runGcsPath: String): String =
if (file.startsWith(GCS_PREFIX)) file
else uploadToRemoteStorage(
RemoteStorage.Dir(rootGcsBucket, runGcsPath),
RemoteStorage.Data(file, Files.readAllBytes(Paths.get(file)))
)
}

0 comments on commit e174d3e

Please sign in to comment.