hmm pretty shitty so i wrote my own updater
This commit is contained in:
@@ -8,14 +8,14 @@
|
||||
{
|
||||
"name": "flixel-yc29",
|
||||
"type": "git",
|
||||
"dir": null,
|
||||
"dir": "flixel",
|
||||
"ref": "master",
|
||||
"url": "https://www.github.com/YoshiCrafter29/flixel"
|
||||
},
|
||||
{
|
||||
"name": "flxanimate",
|
||||
"type": "git",
|
||||
"dir": null,
|
||||
"dir": "flxanimate",
|
||||
"ref": "master",
|
||||
"url": "https://github.com/Dot-Stuff/flxanimate/"
|
||||
},
|
||||
@@ -27,7 +27,7 @@
|
||||
{
|
||||
"name": "hscript-improved",
|
||||
"type": "git",
|
||||
"dir": null,
|
||||
"dir": "hscript-improved",
|
||||
"ref": "master",
|
||||
"url": "https://www.github.com/YoshiCrafter29/hscript-improved"
|
||||
},
|
||||
@@ -44,7 +44,7 @@
|
||||
{
|
||||
"name": "linc_discord-rpc",
|
||||
"type": "git",
|
||||
"dir": null,
|
||||
"dir": "linc_discord-rpc",
|
||||
"ref": "master",
|
||||
"url": "https://github.com/Aidan63/linc_discord-rpc"
|
||||
},
|
||||
|
||||
+1
-3
@@ -1,3 +1 @@
|
||||
haxelib install hmm
|
||||
haxelib run hmm setup
|
||||
hmm install
|
||||
@haxe -cp update -D analyzer-optimize -main Update --interp
|
||||
@@ -0,0 +1,44 @@
|
||||
import haxe.Json;
|
||||
import sys.io.File;
|
||||
import sys.FileSystem;
|
||||
|
||||
class Update {
|
||||
public static function main() {
|
||||
// to prevent messing with currently installed libs
|
||||
if (!FileSystem.exists('.haxelib'))
|
||||
FileSystem.createDirectory('.haxelib');
|
||||
|
||||
var json:Array<Library> = Json.parse(File.getContent('./hmm.json')).dependencies;
|
||||
prettyPrint("Installing libraries...");
|
||||
for(lib in json) {
|
||||
// install lib.
|
||||
switch(lib.type) {
|
||||
case "haxelib":
|
||||
prettyPrint('Installing haxelib ${lib.name}...');
|
||||
Sys.command('haxelib install ${lib.name}');
|
||||
case "git":
|
||||
prettyPrint('Installing ${lib.name} from git url ${lib.url}');
|
||||
Sys.command('haxelib git ${lib.name} ${lib.url}');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static function prettyPrint(text:String) {
|
||||
var header = "══════";
|
||||
for(i in 0...text.length)
|
||||
header += "═";
|
||||
Sys.println("");
|
||||
Sys.println('╔$header╗');
|
||||
Sys.println('║ $text ║');
|
||||
Sys.println('╚$header╝');
|
||||
}
|
||||
}
|
||||
|
||||
typedef Library = {
|
||||
var name:String;
|
||||
var type:String;
|
||||
var version:String;
|
||||
var dir:String;
|
||||
var ref:String;
|
||||
var url:String;
|
||||
}
|
||||
Reference in New Issue
Block a user