#!/usr/bin/env moshell npm build react mkdir -p /outputs/public apt update && apt install jq -y npm install npm run build -- --base=/IQBall/public // Read generated mappings from build val result = $(jq -r 'to_entries|map(.key + " " +.value.file)|.[]' dist/manifest.json) val mappings = $result.split('\n') echo ' views-mappings.php while $mappings.len() > 0 { val mapping = $mappings.pop().unwrap(); val mapping = $mapping.split(' '); val source_file = $mapping[0] val build_file = $mapping[1] echo "\t'$source_file' => '$build_file'," >> views-mappings.php } echo "];" >> views-mappings.php chmod +r views-mappings.php // moshell does not supports file patterns bash <<< "mv dist/* public/* front/assets/ /outputs/public/" mv views-mappings.php /outputs/