Don't create token.txt if it already exists
This commit is contained in:
@@ -4,11 +4,13 @@ task accessToken {
|
||||
def rawDir = new File("app/src/main/res/raw")
|
||||
rawDir.mkdirs()
|
||||
def tokenFile = new File("app/src/main/res/raw/token.txt")
|
||||
String token = System.getenv('MAPBOX_ACCESS_TOKEN')
|
||||
if (token == null) {
|
||||
throw new InvalidUserDataException("You must set the MAPBOX_ACCESS_TOKEN environment variable.")
|
||||
if (!tokenFile.exists()) {
|
||||
String token = System.getenv('MAPBOX_ACCESS_TOKEN')
|
||||
if (token == null) {
|
||||
throw new InvalidUserDataException("You must set the MAPBOX_ACCESS_TOKEN environment variable.")
|
||||
}
|
||||
tokenFile.write(token)
|
||||
}
|
||||
tokenFile.write(token)
|
||||
}
|
||||
|
||||
gradle.projectsEvaluated {
|
||||
|
||||
Reference in New Issue
Block a user