#!/bin/bash
function SettingExecution() {
echo "ビルドに必要な環境情報を入力してください。"
read -p 'Contentful Space ID: ' CTF_SPACE_ID
read -p 'Contentful Content Delivery API - access token: ' CTF_CDA_ACCESS_TOKEN
read -p 'Contentful Content Preview API - access token: ' CTF_CDA_ACCESS_TOKEN_PREVIEW
if [ -n "$CTF_SPACE_ID" -a -n "$CTF_CDA_ACCESS_TOKEN" -a -n "$CTF_CDA_ACCESS_TOKEN_PREVIEW" ]; then
{
echo "CTF_SPACE_ID=$CTF_SPACE_ID"
echo "CTF_CDA_ACCESS_TOKEN=$CTF_CDA_ACCESS_TOKEN"
echo "CTF_CDA_ACCESS_TOKEN_PREVIEW=$CTF_CDA_ACCESS_TOKEN_PREVIEW"
} > .env
echo "入力された内容で.envファイルを作成しました。"
else
echo "入力された値が不足しています。"
echo "スクリプトを終了します。"
exit 1
fi
}
SettingExecution
More than 3 years have passed since last update.
Register as a new user and use Qiita more conveniently
- You get articles that match your needs
- You can efficiently read back useful information
- You can use dark theme