9
0

50 lines
1.2 KiB
Bash
Raw Normal View History

2024-03-27 15:52:09 +01:00
#!/usr/bin/env bash
#set -euxo pipefail
set -euo pipefail
#
# EXIT CODES
############
DEFAULT_REQ_TOOL_EXIT_CODE=1
DEFAULT_ARG_ERROR_EXIT_CODE=2
DEFAULT_MAIN_ERROR_EXIT_CODE=10
# Define the file path
FILE_PATH="${BASH_SOURCE%/*}/MetaPluginDemo/Credentials.swift"
# remove filename
TARGET_DIRECTORY="${FILE_PATH%/*}"
mkdir -p "$TARGET_DIRECTORY"
# Check if the file does not exist
if [[ ! -f $FILE_PATH ]]; then
# The file does not exist, create it with the specified content using a here document
cat << 'EOF' > "$FILE_PATH"
/*
* Created by WebID Solutions GmbH | www.webid-solutions.de.
* See the file "LICENSE" for the full license governing this code.
*/
import Foundation
class Credentials {
static let demoUsernameTest: String = "your demo user name for test"
static let demoApiKeyTest: String = "your demo api key for test"
static let demoUsernameProduction: String = "your demo user name for production"
static let demoApiKeyProduction: String = "your demo api key for production"
static let actionId: String = "your action-id here"
static let environment : EWebIDEnv.WebIDEnv = EWebIDEnv.TEST
}
EOF
else
echo "The file already exists."
fi