Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Geek Culture / Command line help?

Author
Message
Neuro Fuzzy
17
Years of Service
User Offline
Joined: 11th Jun 2007
Location:
Posted: 25th Aug 2010 10:22
I've always gotten annoyed by directories when dealing with command line.

Basically, I have this executable "samHaxe.exe" that reads an xml file and compiles it to an SWF file. That's all fine, but what I ahve to type to do that all is this:


>chdir /d D:\
>cd "D:\Program Files\dev\flashdev\samHaxe"
>samhaxe "..\..\Game1\src\resourceconfig.xml" "..\..\Game1\src\resources.swf"

Ideally I would be able to CD to the directory "Game1\src\" and say:
>samHaxe resourceconfig.xml resources.swf

without all that directory crap. The problem is samHaxe isn't recognized as a command. I've tried adding "D:\Program Files\Dev\flashdev\samHaxe\" to System Properties -> environment variables to no avail (I did restart my computer.

I have verified samhaxe.exe is in D:\program files\dev\flashdev\samhaxe

any help?


Is't life, I ask, is't even prudence, to bore thyself and bore thy students?
AutoBot
15
Years of Service
User Offline
Joined: 25th Sep 2009
Location: Everywhere
Posted: 26th Aug 2010 03:34
One thing I would do would be to program my own command line environment, which would interact with the actual commad line. This would allow you to type in >samHaxe resourceconfig.xml resources.swf and implement the functions you want. Other than that I'm not much of a cmd expert...

BearCDP
15
Years of Service
User Offline
Joined: 7th Sep 2009
Location: NYC
Posted: 26th Aug 2010 20:15 Edited at: 26th Aug 2010 20:20
You added it to your PATH and didn't get any results? Windows only looks in directories specified in PATH.

Having to switch drives shouldn't be an issue. I run Cygwin, Python, and Ruby form a data drive, but have my profile on the system drive.

You could write a batch/python/ruby/perl/cygwin-bash/whatever script like AutoBot is suggesting that takes 'Game1 resourceconfig.xml resources.swf' as arguments, and knows to look for a directory named src in D:\Program Files\dev\Game1 and run samHaxe on the files there.

Another option would be to just start a cmd (or bash ) shell and set your samHaxe path equal to an environment variable named something simple like %SH%. Then you just have to type "%SH%\samHaxe" resourceconfig.xml resources.swf.

I'd personally recommend Python or Ruby first, and bash/cygwin second, but only because batch scripts look ugly as sin to me.

Check out this WIP flash game from the Global Game Jam!

Login to post a reply

Server time is: 2025-05-23 15:13:23
Your offset time is: 2025-05-23 15:13:23