Skip to content

Instantly share code, notes, and snippets.

@cutecprog
Last active January 14, 2022 05:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cutecprog/827ef8a82d65a1a27f133fd89392f1b0 to your computer and use it in GitHub Desktop.
Save cutecprog/827ef8a82d65a1a27f133fd89392f1b0 to your computer and use it in GitHub Desktop.
pico8 git integration (lua code)
-- > run breadcrumb text
-- write stat(6) to file to use
-- as git commit message
-- call in _init()
function add_commit_message()
-- check if message entered
if #stat(6) > 1 then
-- write message to file
printh(stat(6), "msg", true)
-- report success (opt)
?"commit message set"
-- sleep for 30 frames (opt)
for i=1, 30 do flip() end
-- reset breadcrumb
run(" ")
end
end
#! /bin/bash
# Run script to call pico8
~/pico-8/pico8 &
while true; do
inotifywait -qq -e CLOSE_WRITE ~/.lexaloffle/pico-8/carts/*.p8
cd ~/.lexaloffle/pico-8/carts
git add *.p8
if test -f msg.p8l; then
git commit -a -F msg.p8l
rm msg.p8l
else
git commit -am "autocommit"
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment