In a bash script, one would normally use cat to create a file.
cat > ___check_config.js <<END_CONFIG_CHECK
let config = JSON.parse(require('fs').readFileSync('config/config.json'));
if(config.hasForceOptions !== undefined && config.hasForceOptions.enabled !== false){process.exit(255);} else {process.exit(0);}
END_CONFIG_CHECK
I would expect this to create the file (and it does, in bash)
let config = JSON.parse(require('fs').readFileSync('config/config.json'));
if(config.hasForceOptions !== undefined && config.hasForceOptions.enabled !== false){process.exit(255);} else {process.exit(0);}
BUT, when i add this script to the gitlab-ci.yml file… i get
echo $'\x1b[32;1m$ let config = JSON.parse(require(\'fs\').readFileSync(\'config/config.json\'));\x1b[0;m'
let config = JSON.parse(require('fs').readFileSync('config/config.json'));
echo $'\x1b[32;1m$ if(config.hasForceOptions !== undefined && config.hasForceOptions.enabled !== false) {process.exit(255);} else {process.exit(0);}\x1b[0;m'
if(config.hasForceOptions !== undefined && config.hasForceOptions.enabled !== false) {process.exit(255);} else {process.exit(0);}
echo $'\x1b[32;1m$ END_CONFIG_CHECK\x1b[0;m'
it contains text intended to be echoed to the onsole in the gitlab web UI.
BUG??
or, my fault?
STRANGELY… useing the same input re-direction works without error for ftp…
# UPLOAD TO FTP SITE.
- ftp -p -v -n "$RFX_FTP_URL" <<END_FTP
- quote USER $RFX_FTP_USER
- quote PASS $RFX_FTP_PASS
- binary
- prompt
- mdelete $GAME_NAME/*
- mkdir $GAME_NAME
- cd $GAME_NAME
- put $RELEASE_DIR.zip.part
- rename $RELEASE_DIR.zip.part $RELEASE_DIR.zip
- put $RELEASE_DIR.zip.sha512.part
- rename $RELEASE_DIR.zip.sha512.part $RELEASE_DIR.zip.sha512
- put $SOURCEMAP_DIR.zip.part
- rename $SOURCEMAP_DIR.zip.part $SOURCEMAP_DIR.zip
- quit
- END_FTP
an odd one!?