Skip to content

Commit

Permalink
Add script to generate secrets file
Browse files Browse the repository at this point in the history
  • Loading branch information
pietrocaselani committed Mar 3, 2019
1 parent 2281baa commit 6007077
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 8 deletions.
10 changes: 5 additions & 5 deletions CouchTracker.xcodeproj/project.pbxproj
Expand Up @@ -2881,7 +2881,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "sh $SRCROOT/scripts/swiftformat\n";
shellScript = "sh $SRCROOT/build_phases/swiftformat\n";
};
4FAC4A92210F281D0096BCE0 /* SwiftFormat */ = {
isa = PBXShellScriptBuildPhase;
Expand Down Expand Up @@ -2909,7 +2909,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "sh $SRCROOT/scripts/swiftformat\n";
shellScript = "sh $SRCROOT/build_phases/swiftformat\n";
};
4FAC4A94210FDD4B0096BCE0 /* SwiftFormat */ = {
isa = PBXShellScriptBuildPhase;
Expand All @@ -2923,7 +2923,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "sh $SRCROOT/scripts/swiftformat\n";
shellScript = "sh $SRCROOT/build_phases/swiftformat\n";
};
6455BA751F45B862000660C6 /* SwiftLint */ = {
isa = PBXShellScriptBuildPhase;
Expand Down Expand Up @@ -3015,7 +3015,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "sh $SRCROOT/scripts/swiftformat\n";
shellScript = "sh $SRCROOT/build_phases/swiftformat\n";
};
824A784C220F68830001F3BF /* SwiftLint */ = {
isa = PBXShellScriptBuildPhase;
Expand Down Expand Up @@ -3051,7 +3051,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "sh $SRCROOT/scripts/swiftformat\n";
shellScript = "sh $SRCROOT/build_phases/swiftformat\n";
};
9C6F0D2340CF87135C62A2BE /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
Expand Down
2 changes: 0 additions & 2 deletions CouchTracker/Info.plist
Expand Up @@ -31,8 +31,6 @@
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
Expand Down
2 changes: 1 addition & 1 deletion Readme.md
Expand Up @@ -19,7 +19,7 @@ Run the following commands

* This project uses the [Trakt API](https://trakt.docs.apiary.io/), [TMDB API](https://developers.themoviedb.org/3/getting-started) and [TVDB API](https://api.thetvdb.com/swagger)

* To run the app, please create a file at `CouchTracker/Utils/Secrets.swift` with yours API keys like this
* To run the app, please create a file at `CouchTrackerApp/Utils/Secrets.swift` with yours API keys like this

```swift
enum Secrets {
Expand Down
File renamed without changes.
24 changes: 24 additions & 0 deletions scripts/generate_secrets
@@ -0,0 +1,24 @@
#!/bin/bash

SCRIPTS_DIR=$(cd "$(dirname "$0")" || exit 1; pwd)
SECRETS_FILE="${SCRIPTS_DIR}/../CouchTrackerApp/Utils/Secrets.swift"

cat > "$SECRETS_FILE" << EOF
enum Secrets {
enum Trakt {
static let clientId = "${COUCH_TRACKER_TRAKT_CLIENT_ID}"
static let clientSecret = "${COUCH_TRACKER_TRAKT_CLIENT_SECRET}"
static let redirectURL = "${COUCH_TRACKER_TRAKT_REDIRECT_URL}"
}
enum TMDB {
static let apiKey = "${COUCH_TRACKER_TMDB_API_KEY}"
}
enum TVDB {
static let apiKey = "${COUCH_TRACKER_TVDB_API_KEY}"
}
}
EOF

echo "Generated file: ${SECRETS_FILE}"

0 comments on commit 6007077

Please sign in to comment.