~mrms/umbox

f5317c72930909e0fa6cdc9a2a93c0de05c9ee80 — Marek Ma┼íkarinec 3 months ago 966f4b2 master
Update to new os.um

Signed-off-by: Marek Maškarinec <marek@mrms.cz>
3 files changed, 9 insertions(+), 9 deletions(-)

M src/common.um
M src/run.um
M src/update.um
M src/common.um => src/common.um +3 -3
@@ 108,9 108,9 @@ fn (b: ^FileBox) download*(file: str = "box.tar"): ([]char, std.Err) {
	}
	
	if file == "version" {
		sb, oserr := os.stat(b.path)
		if oserr != 0 {
			return {}, std.error(oserr, os.strerror(oserr))
		sb, err := os.stat(b.path)
		if err.code != 0 {
			return {}, err
		}
		
		return []char(std.itoa(sb.mtime)), {}

M src/run.um => src/run.um +2 -2
@@ 21,7 21,7 @@ fn run*(url: str, argi: int): std.Err {
	cmd := meta.run
	pathSep := ""
	
	if os.getPlatform() == os.PlatformPosix {
	if os.getPlatform() == os.Platform.posix {
		if len(meta.runPosix) != 0 {
			cmd = meta.runPosix
		}


@@ 29,7 29,7 @@ fn run*(url: str, argi: int): std.Err {
		pathSep = ":"
	}
	     
	if os.getPlatform() == os.PlatformWindows {
	if os.getPlatform() == os.Platform.windows {
		if len(meta.runWindows) != 0 {
			cmd = meta.runWindows
		}

M src/update.um => src/update.um +4 -4
@@ 74,8 74,8 @@ fn fetchDep(dep: common.Box, versions: ^map[str]str): std.Err {
				copyFile(file, file2)
			}, { excludeDirs: true })
		} else {
			oserr := os.link(filepath.join("..", "..", d.getName()), filepath.join("umbox", dep.getName(), "umbox", d.getName()))
			if oserr != 0 && os.getPlatform() == os.PlatformWindows {
			err := os.link(filepath.join("..", "..", d.getName()), filepath.join("umbox", dep.getName(), "umbox", d.getName()))
			if err.code != 0 && os.getPlatform() == os.Platform.windows {
				std.system("mklink /j " + filepath.join("umbox", dep.getName(), "umbox", d.getName()) + " " + filepath.join("umbox", d.getName()))
			}
		}


@@ 225,8 225,8 @@ fn run*(url: str, argi: int): std.Err {
			fprintf(std.stderr(), "Removing %s...\n", d)
			os.walk(filepath.join("umbox", d), fn(path: str) |d| {
				err := os.remove(path)
				if err != 0 {
					fprintf(std.stderr(), "Error removing %s: %s\n", path, os.strerror(err))
				if err.code != 0 {
					fprintf(std.stderr(), "Error removing %s: %s\n", path, err.msg)
				}
			}, { skipLinks: true })