GithubLoader v1.0.0-beta

GithubLoader


For people who want make really big project and "share" it easily with other (for example for beta test). I've write share in double quotes because code are not save in tabs of project. One advantage of this technique : code is auto-updated when you commit on your github.


For : Project Author


If you want create a github project, you need to respect this organisation :
~~~
  • project.info – list of packages
  • Setup.lua – setup function
  • Main.lua – draw and other main functions
  • Package1, Package2, …
    • package.info – list of files in package
    • File1, File2
<hr />
<h3>For : Client</h3>
<br />
<h5>Create a codea project and replace the main by :</h5>
<pre lang="lua">
PROJECTURL = 'https://github.com/HyroVitalyProtago/AllFighters-Codea-Project' -- example
http.request('https://dl.dropboxusercontent.com/s/gddv4c7r24ss51k/GithubLoader.lua.txt?'
    .. 'token_hash=AAGw5ueVBqNSmff4HotZEr8WoNpCg7p0pOlw5uF5zY7gwA&dl=1', function(data)
    assert(loadstring(data))()
end, alert)

```

<p><strong>/!\\ Warning</strong> Don't forget to change the PROJECTURL by the project what you want ;)</p>
<hr />
<h3>Roadmap</h3>
<br />
<ul>
<li>Update stability with advanced callback system</li>
<li><strong>Use of github api => System for auto-download sprites</strong></li>
<li>Save code in tab or project data</li>
<li>Alert on new version (commit, release)</li>
<li>AutoGist compatibility</li>
</ul>
<hr />
<h3>Suggestions</h3>
<br />
<p>I will update this section with your suggestions</p>
<hr />
<h3>Informations</h3>
<br />
<p>For the moment, the project in example is an old version of my current development (AllFighters)</p>
<p><strong>[Edit]</strong> If you want run the template project, you need download this directory in your dropbox in a directory named "SpriteAllFighters": https://www.dropbox.com/sh/kxwtvcloew5djeq/KoMQMZJjRO?lst</p>

Interesting Idea! However, It pulls the code but the loadstring does not seem to be executing allfighters.

It’s working now, however it does not seem to be pulling images. Getting Texture errors.

@Briarfox yes, you need this : https://www.dropbox.com/sh/kxwtvcloew5djeq/KoMQMZJjRO?lst

In your dropbox codea directory, make a directory “SpriteAllFighters”

A little advice if I may, Have your program check for the images and download them if they are not present :slight_smile:

@Briarfox yes, i think about that… But dropbox url are not user friend, and i don’t know how to make an auto downloader…

I haven’t looked into the dropbox api yet but that might be a solution. I’ll see if I can make a loader. How are you uploading your projects to github? I’ve started re-writting the github codea project to work with oAuth. I like your loader idea!

@Briarfox I write code and commit directly on my mac.

And i think dropbox api are not the real solution because you need an authentication, and i think you are not able to list files of another user… and even if this is possible, you need to re-create architecture of dropbox directories and you can’t made directory directly in lua (for the moment, i expect lfs with impatience).

Very interesting idea! As you mentioned would definitely want to cache the project in a tab so you don’t end up re-downloading it for every build :slight_smile: and perhaps an easy way round resources is have a “resources.info” file or a resources folder.

You could also perhaps read project tab info and from the AutoGist tab order file if available so you don’t have to add extra organisation to your project initially :wink: and then use your project organisation to extend it :slight_smile:

@XanDDemoX Thanks !

And for ressources, i try to find the best solution with the little configuration as possible…

AutoGist is a really good solution, but i think, if you want use github with all features (commit, issues, releases, branch, etc…), you don’t need gist…
But i can make this easily if people really want this feature ^^

Gist compatibility would let small projects benefit too and it’s also already quite widely in
use already so it would help you get a bigger user-base :wink: . Also a gist is essentially a mini GitHub repository and can be forked to a full one at any time, so would be useful for when a small project grows into a large one and is inevitably migrated to make use of the full feature set :wink: