Last active
October 6, 2024 22:46
-
-
Save crcdng/5d21f0ba770a8a68aecc86e319ef6aa3 to your computer and use it in GitHub Desktop.
Revisions
-
crcdng revised this gist
Oct 6, 2024 . 1 changed file with 12 additions and 4 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,7 +1,9 @@ #!/bin/sh # builds and prepares a Flutter/Flame web build for itch.io # tested on Mac # added: create output dir if it does not exist # added: mitigate bug where keyboard keys are working fine locally but aren’t recognized on itch.io. # after uploading set the dimensions in the "Embed options" section on itch.io # set these parameters before running @@ -10,11 +12,17 @@ PROJECT_DIR='FULL PATH TO THE FLUTTER DIRECTORY OF YOUR PROJECT' TEMP_BUILD_DIR='FULL PATH TO A TEMPORARY DIRECTORY (WILL BE CREATED AND DELETED AT THE END)' OUTPUT_DIR='FULL PATH TO THE DIRECTORY WHERE THE ZIP FILE READY FOR UPLOAD TO ITCH.IO WILL BE PUT' if [ ! -d "$OUTPUT_DIR" ]; then echo "$OUTPUT_DIR does not exist. creating it" mkdir "$OUTPUT_DIR" fi cd $PROJECT_DIR && flutter build web && cp -R "${PROJECT_DIR}/build/web" $TEMP_BUILD_DIR && sleep 1 && cd $TEMP_BUILD_DIR && sed -i '' 's/<base href="\/">//g' index.html && sed -i '' 's/<body>/<body>\n<script>window.onclick = function () { window.focus(); }<\/script>/g' index.html && zip -vr "${OUTPUT_DIR}/${PROJECT_NAME}_$(date +%Y%m%d-%H%M%S).zip" ./ -x "*.DS_Store" rm -r $TEMP_BUILD_DIR -
crcdng revised this gist
May 28, 2024 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -13,6 +13,7 @@ OUTPUT_DIR='FULL PATH TO THE DIRECTORY WHERE THE ZIP FILE READY FOR UPLOAD TO IT cd $PROJECT_DIR && flutter build web && cp -R "${PROJECT_DIR}/build/web" $TEMP_BUILD_DIR && sleep 1 && # recently breaks without waiting a bit after building cd $TEMP_BUILD_DIR && sed -i '' 's/<base href="\/">//g' index.html && zip -vr "${OUTPUT_DIR}/${PROJECT_NAME}_$(date +%Y%m%d-%H%M%S).zip" ./ -x "*.DS_Store" && -
crcdng revised this gist
May 9, 2024 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -2,6 +2,7 @@ # shell script to build and prepare a Flutter/Flame web project for itch.io # tested on Mac # after uploading set the dimensions in the "Embed options" section on itch.io # set these parameters before running PROJECT_NAME='NAME' -
crcdng revised this gist
May 9, 2024 . No changes.There are no files selected for viewing
-
crcdng renamed this gist
May 9, 2024 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,6 @@ #!/bin/sh # shell script to build and prepare a Flutter/Flame web project for itch.io # tested on Mac # set these parameters before running -
crcdng revised this gist
May 8, 2024 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,7 @@ #!/bin/sh # builds and prepares a Flutter/Flame web build for itch.io # tested on Mac # set these parameters before running PROJECT_NAME='NAME' -
crcdng revised this gist
May 8, 2024 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -5,7 +5,7 @@ # set these parameters before running PROJECT_NAME='NAME' PROJECT_DIR='FULL PATH TO THE FLUTTER DIRECTORY OF YOUR PROJECT' TEMP_BUILD_DIR='FULL PATH TO A TEMPORARY DIRECTORY (WILL BE CREATED AND DELETED AT THE END)' OUTPUT_DIR='FULL PATH TO THE DIRECTORY WHERE THE ZIP FILE READY FOR UPLOAD TO ITCH.IO WILL BE PUT' cd $PROJECT_DIR && -
crcdng revised this gist
May 8, 2024 . 1 changed file with 5 additions and 4 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -2,10 +2,11 @@ # builds and prepares a Flutter/Flame web build for itch.io # set these parameters before running PROJECT_NAME='NAME' PROJECT_DIR='FULL PATH TO THE FLUTTER DIRECTORY OF YOUR PROJECT' TEMP_BUILD_DIR='FULL PATH TO A TEMPORARY DIRECTORY (TEMPORARY, WILL BE CREATED AND DELETED AT THE END)' OUTPUT_DIR='FULL PATH TO THE DIRECTORY WHERE THE ZIP FILE READY FOR UPLOAD TO ITCH.IO WILL BE PUT' cd $PROJECT_DIR && flutter build web && -
crcdng created this gist
May 8, 2024 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,16 @@ #!/bin/sh # builds and prepares a Flutter/Flame web build for itch.io PROJECT_NAME='ttt' PROJECT_DIR='/Users/m/root/dev/flutter/games/ggj/ttt' TEMP_BUILD_DIR='/Users/m/Desktop/ttt' OUTPUT_DIR='/Users/m/Desktop' cd $PROJECT_DIR && flutter build web && cp -R "${PROJECT_DIR}/build/web" $TEMP_BUILD_DIR && cd $TEMP_BUILD_DIR && sed -i '' 's/<base href="\/">//g' index.html && zip -vr "${OUTPUT_DIR}/${PROJECT_NAME}_$(date +%Y%m%d-%H%M%S).zip" ./ -x "*.DS_Store" && rm -r $TEMP_BUILD_DIR