From aea30d2b44f6099645a70341ba508f853c167e23 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ali=20Parlak=C3=A7=C4=B1?= Date: Sat, 15 May 2021 13:11:01 +0300 Subject: [PATCH] Check if REDDIT_TOKEN is set (#376) --- devscripts/configure.ps1 | 7 +++++-- devscripts/configure.sh | 7 +++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/devscripts/configure.ps1 b/devscripts/configure.ps1 index 8ac0ce1..b096266 100644 --- a/devscripts/configure.ps1 +++ b/devscripts/configure.ps1 @@ -1,2 +1,5 @@ -copy .\\bdfr\\default_config.cfg .\\test_config.cfg -echo "`nuser_token = $env:REDDIT_TOKEN" >> ./test_config.cfg \ No newline at end of file +if (-not ([string]::IsNullOrEmpty($env:REDDIT_TOKEN))) +{ + copy .\\bdfr\\default_config.cfg .\\test_config.cfg + echo "`nuser_token = $env:REDDIT_TOKEN" >> ./test_config.cfg +} \ No newline at end of file diff --git a/devscripts/configure.sh b/devscripts/configure.sh index 48e7c3e..d9c96df 100755 --- a/devscripts/configure.sh +++ b/devscripts/configure.sh @@ -1,2 +1,5 @@ -cp ./bdfr/default_config.cfg ./test_config.cfg -echo -e "\nuser_token = $REDDIT_TOKEN" >> ./test_config.cfg \ No newline at end of file +if [ ! -z "$REDDIT_TOKEN" ] +then + cp ./bdfr/default_config.cfg ./test_config.cfg + echo -e "\nuser_token = $REDDIT_TOKEN" >> ./test_config.cfg +fi \ No newline at end of file