File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ 2.0.1:
2+ * Corrected build of Highlight to run on Leopard.
3+ * Stop redirecting stdout of colorize.sh to stdin. Error output will appear
4+ in the console instead of the preview.
5+ * Added qlcc_debug option. To enable, use:
6+ defaults write org.n8gray.qlcolorcode qlcc_debug 1
7+ To disable, use:
8+ defaults delete org.n8gray.qlcolorcode qlcc_debug
9+
1102.0:
211 * Added a note about conflict with Xcode 3.2's source code QL plugin. If
312 you're having problems with QLCC on Snow Leopard please read it!
Original file line number Diff line number Diff line change 2525 NSPipe *pipe;
2626 pipe = [NSPipe pipe ];
2727 [task setStandardOutput: pipe];
28- [task setStandardError: pipe];
28+ // Let stderr go to the usual place
29+ // [task setStandardError: pipe];
2930
3031 NSFileHandle *file;
3132 file = [pipe fileHandleForReading ];
6970 NSMutableDictionary *env = [NSMutableDictionary dictionaryWithDictionary:
7071 [[NSProcessInfo processInfo ] environment ]];
7172 [env addEntriesFromDictionary: [NSDictionary dictionaryWithObjectsAndKeys:
73+ #ifdef DEBUG
74+ @" 1" , @" qlcc_debug" ,
75+ #endif
7276 @" 9" , @" fontSizePoints" ,
7377 @" Monaco" , @" font" ,
7478 @" ide-xcode" , @" hlTheme" ,
8589
8690 output = runTask (cmd, env, status);
8791 if (*status != 0 ) {
88- NSLog (@" QLColorCode: colorize.sh failed with exit code %d " , *status);
92+ NSLog (@" QLColorCode: colorize.sh failed with exit code %d . Command was (%@ )." ,
93+ *status, cmd);
8994 }
9095 return output;
9196}
Original file line number Diff line number Diff line change 327327 );
328328 runOnlyForDeploymentPostprocessing = 0;
329329 shellPath = "/bin/zsh -x";
330- shellScript = "set err_exit\ncd $PROJECT_DIR/highlight\nexport CFLAGS ='-arch i386 -arch ppc -arch x86_64'\nexport LDFLAGS=$CFLAGS \nmake\n# Make sure it was built universal\nlipo -info src/highlight | grep -q ppc || exit 1\nlipo -info src/highlight | grep -q i386 || exit 1\nlipo -info src/highlight | grep -q x86_64 || exit 1\nmake \\\n\tDESTDIR=$BUILT_PRODUCTS_DIR/$UNLOCALIZED_RESOURCES_FOLDER_PATH \\\n\tPREFIX=/highlight/ \\\n\tinstall\n\n";
330+ shellScript = "set err_exit\ncd $PROJECT_DIR/highlight\nX ='-arch ppc -arch i386 -arch x86_64 -isysroot /Developer/SDKs/MacOSX10.5.sdk -mmacosx-version-min=10.5 '\nexport CFLAGS=$X\nexport LDFLAGS=$X \nmake -j 2 \n# Make sure it was built universal\nlipo -info src/highlight | grep -q ppc || exit 1\nlipo -info src/highlight | grep -q i386 || exit 1\nlipo -info src/highlight | grep -q x86_64 || exit 1\nmake \\\n\tDESTDIR=$BUILT_PRODUCTS_DIR/$UNLOCALIZED_RESOURCES_FOLDER_PATH \\\n\tPREFIX=/highlight/ \\\n\tinstall\n\n";
331331 showEnvVarsInLog = 0;
332332 };
333333/* End PBXShellScriptBuildPhase section */
427427 2CA326230896AD4900168862 /* Debug */ = {
428428 isa = XCBuildConfiguration;
429429 buildSettings = {
430- CURRENT_PROJECT_VERSION = 2.0.0 ;
430+ CURRENT_PROJECT_VERSION = 2.0.1 ;
431431 GCC_PREPROCESSOR_DEFINITIONS = DEBUG;
432432 GCC_WARN_ABOUT_RETURN_TYPE = YES;
433433 GCC_WARN_UNUSED_VARIABLE = YES;
444444 i386,
445445 x86_64,
446446 );
447- CURRENT_PROJECT_VERSION = 2.0.0 ;
447+ CURRENT_PROJECT_VERSION = 2.0.1 ;
448448 GCC_WARN_ABOUT_RETURN_TYPE = YES;
449449 GCC_WARN_UNUSED_VARIABLE = YES;
450450 PREBINDING = NO;
Original file line number Diff line number Diff line change 1919# Fail immediately on failure of sub-command
2020setopt err_exit
2121
22- # echo QLColorCode Devel Version!
23-
2422rsrcDir=$1
2523target=$2
2624thumb=$3
2725
26+ debug () {
27+ if [ " x$qlcc_debug " != " x" ]; then if [ " x$thumb " = " x0" ]; then
28+ echo " QLColorCode: $@ " 1>&2
29+ fi ; fi
30+ }
31+
32+ debug Starting colorize.sh
2833# echo target is $target
2934
3035hlDir=$rsrcDir /highlight
@@ -36,8 +41,10 @@ cmdOpts=(-I --font $font --quiet --add-data-dir $rsrcDir/override \
3641
3742# for o in $cmdOpts; do echo $o\<br/\>; done
3843
44+ debug Setting reader
3945reader=(cat $target )
4046
47+ debug Handling special cases
4148case $target in
4249 * .graffle )
4350 # some omnigraffle files are XML and get passed to us. Ignore them.
@@ -80,8 +87,10 @@ case $target in
8087 lang=${target##* .}
8188 ;;
8289esac
90+ debug Resolved $target to language $lang
8391
8492go4it () {
93+ debug Generating the preview
8594 if [ $thumb = " 1" ]; then
8695 $reader | head -n 100 | head -c 20000 | $cmd --syntax $lang $cmdOpts && exit 0
8796 elif [ -n " $maxFileSize " ]; then
@@ -92,7 +101,11 @@ go4it () {
92101}
93102
94103setopt no_err_exit
104+ debug First try...
95105go4it
96106# Uh-oh, it didn't work. Fall back to rendering the file as plain
107+ debug First try failed, second try...
97108lang=txt
98109go4it
110+ debug Reached the end of the file. That should not happen.
111+ exit 101
You can’t perform that action at this time.
0 commit comments