so, I just downloaded the latest Version of chipmunk, and when I run the iphonestatic.command from finder I get the following output in my Command Line
Last login: Wed Oct 26 22:15:59 on ttys001
PS1:~ Thermo$ /Users/Thermo/Desktop/Programs\ software/Software/iphonestatic.command ; exit;
usage: dirname path
Build settings from command line:
SDKROOT = iphoneos4.3
xcodebuild: error: 'Chipmunk6.xcodeproj' does not exist.
logout
I can't get the script to build the proper files, and have been trying to figure this out for a while,
thanks for any help
Aha! After a stroke of luck I discovered that you could cause that bug by having a space in your path somewhere.
The first line of the script does this to set the working directory to the parent directory of the script when running it from the finder:
cd `dirname $0`
It barfs when you have a space in the path somewhere. Not exactly certain how to fix it... The workaround is easy enough though, just make sure you put it somewhere it won't have a space.
edit: Looks like it just needs multiple sets of parens:
cd "`dirname "$0"`"
Related
I'm trying to install Uppaal on my Mac. I have Catalina installed and I am aware of the workaround posted on here to do with authorisation and have done this.
But when I run the Uppaal script I get an error saying
Error: Unable to access jarfile ./uppaal.jar
I can't figure out what the problem is or how to get around it. Java is up to date.
Help please, I need this for a uni assignment
It seems that UPPAAL will give the above error, if run it from the GUI from a path containing a space.
I will report this to the development team, until they are able to fix it one of the following workaround:
move the files to a path not containing any spaces (NB: the full path must not contain any spaces)
open the uppaal batch file(e.g. by TextEditor) and add this command to the top of it:
cd "$(dirname "$0")"
Just encountered the same issue. Instead of adding cd "$(dirname "$0")" to the uppaal bash script, which is a bit intrusive, I changed line:
HERE=$(dirname "$(readlink -e $0)")
to:
HERE=$(realpath -s "$(dirname "$0")")
This does not change the current directory at time of invocation. Instead it turns the (wrong) relative path of uppaal.jar to an absolute path.
I started using fish today via Cygwin on Windows 10.
Whenever I execute
ls "G:/My Drive/"
I get a list of files and folders within that directory, which indicates that it can find the directory I am pointing ls to.
However, when I execute
cd "G:/My Drive/"
I get an error:
cd: The directory “G:/My Drive/” does not exist
I reinstalled Cygwin and also updated fish and it still behaves the same.
Why doesn't cd work?
I discovered why this was happening; perhaps it can help others who experience the same problem.
It turns out that fish was mounted onto my drive, so instead of typing
cd "G:/My Drive/"
I have to type
cd /cygdrive/g/My\ Drive/dataSources/
UPDATE (27th March 2019):
I found some documentation that highlights this in more detail.
I am a rookie in Python who has been working on Learn Python the Hard Way. This whole process goes well as I have a smattering knowledge on Python until I march into ex46 where I get stuck in the 'Creating the skeleton Project Directory' section. I have no idea where I should run those commands guided on this book. Following are the excerpt of this part:
First, create the structure of your skeleton directory with these commands:
$ mkdir projects
$ cd projects/
$ mkdir skeleton
$ cd skeleton
$ mkdir bin
$ mkdir NAME
$ mkdir tests
$ mkdir docs
I have tried to run these commands in Windows Powershell, only to be warned that these commands can’t be recognized. I also fumbled to execute them in Pycharm, but all in vain. Could someone point out how I could get it done?
In addition, I am somewhat curious about this method because there seems to be handy way to approach this on Pycharm. Could I achieve the same goal on that?
I am using Python 2.7 and all previous exercises operate well until ex46.
You get that error because you're typing a superfluous $ at the beginning of each command. That $ is the (Linux) command prompt. On your Windows machine, it's something like C:\WINDOWS\system32>. Don't type that.
Just type
mkdir projects
and press Enter. That creates a folder (directory) named "projects". Then type
cd projects
and press Enter. That changes the current directory to that new folder you just created. And so on.
Content migrated from comments since this is what actually solved the issue.
Remove the dollar sign $ from the statement, as this is just the symbol used as a CLI prompt not part of the statement itself.
Then type the mkdir command and it should work e.g.
mkdir my_directory
I'm a newbie in OSx development.
I'm creating an installer package using Packagemaker 3.0.4. Since I want to remove the local settings of my app during installation, I decided to remove the com.identifier.plist. However, I'm not that good in scripting and I'm just starting to explore what Packagemaker is capable of.
Ideally, I want my implementation to be as simple as this:
Check if the .plist file exists
Remove it.
I have tried:
#!/bin/sh
defaults delete ~/Library/Preferences/com.identifier.AppName.plist
Then I saved the delete.sh file to the Desktop. I opened the Packagemaker app and provided the path to my Desktop: /Users/MyName/Desktop/delete.sh in the Scripts Postflight. Then I executed build & run. It didn't work. I thought that it might probably be the script, so I changed it to:
#!/bin/sh
rm ~/Library/Preferences/com.identifier.AppName.plist;
Then I loaded the delete.sh file the same way as I did on the script above. But I received this error:
Mar 29 20:50:54 Mac-mini installd[5425]: PackageKit: Install Failed: PKG: post-flight scripts for "com.testIdentifier.test.AppName.pkg"\nError Domain=PKInstallErrorDomain Code=112 UserInfo=0x100404220 "An error occurred while running scripts from the package “test.pkg”." {\n NSFilePath = "./postflight";\n NSLocalizedDescription = "An error occurred while running scripts from the package \U201ctest.pkg\U201d.";\n NSURL = "./Contents/Packages/test.pkg -- file://localhost/Users/MyName/Desktop/AppName.mpkg/";\n PKInstallPackageIdentifier = "com.testIdentifier.test.AppName.pkg";\n}
If anyone who has a Step-by-Step implementation of creating & adding script to the Packagemaker, and perhaps, my scripts aren't correct, it would be awesome if you could help me out.
Thank you so much in advance! :)
Did you try to launch your delete.sh from terminal? Looks like you have an error in syntax - ';' at the end of the rm command, and you should use -f flag for the rm command (see man rm) in other case script will prompt for confirmation and postflight script can't be interactive.
Edit: as 一二三 mentioned semicolon - is not the point, you should probably look to his answer. And before you'll create your package just try your script in terminal (you can do sudo su before to login as root)
I've got it...
Here's my script:
#!/usr/bin/env bash
file=~/Library/Preferences//com.identifier.AppName.plist
if [ -e "$file" ]
then
# file is found
/usr/bin/defaults delete ~/Library/Preferences//com.identifier.AppName
else
# file not found."
fi
exit 0
I then added it to PackageMaker. I'm not really sure if I'm right but I might have just forgotten to add the script's file into the contents. That's why it never worked earlier. I just put the script's path on the postflight.
Anyway, thanks a lot to everyone for the tips.
I'm doing some Android development and want to access the command line tools from anywhere.
There wasn't an existing .bash_profile file in my home directory so I created one and added the following line:
export PATH="/Users/Me/desktop/Android/Android SDK bundle/sdk/platform-tools"
I can now access the Android tools from terminal, however the ls command has stopped working, though cd still works. I get
-bash: ls: command not found
What should I do to get it to work again (and why has ls stopped working but cd still works?).
Try:
export PATH=$PATH:"/Users/Me/desktop/Android/Android SDK bundle/sdk/platform-tools"
It will append to the current PATH your sdk directory.
As for the later question, it stopped working because you overwritten your PATH variable, so bash can't find your binaries. However cdis a builtin command (http://linux.about.com/library/cmd/blcmdl1_builtin.htm) it doesn't need a path to be located and executed.