Skip to content

Conversation

@justingeeslin
Copy link
Member

This PR fixes issue #20 by implementing proper file association for .cgt files on macOS.

Changes Made

  1. Info.plist Configuration: Added CFBundleDocumentTypes section to register CogTool as the editor for .cgt files
  2. Argument Passing Fix: Fixed the cogtoolstart script to use "$@" instead of $* for proper argument passing with spaces in filenames
  3. Test Coverage: Added comprehensive test to verify file association and argument parsing works correctly

Technical Details

The root cause was that arguments weren't being passed correctly from macOS through the shell script to the Java application. The fix ensures:

  • macOS recognizes CogTool as the default application for .cgt files
  • File paths are properly passed through the shell script to Java
  • PSN (Process Serial Number) arguments from macOS are correctly ignored
  • File paths with spaces are handled correctly

Testing

Added FileAssociationTest.java which verifies:

  • Arguments are correctly parsed by the Java application
  • File paths are properly extracted from command line arguments
  • PSN arguments are ignored as expected
  • Multiple file arguments work correctly

The test passes successfully, confirming the fix works as intended.

Fixes #20

@justingeeslin can click here to continue refining the PR

- Add CFBundleDocumentTypes to Info.plist to register .cgt file association
- Fix argument passing in cogtoolstart script (use "$@" instead of $*)
- Add test to verify file association and argument parsing works correctly
- Ensure PSN arguments from macOS are properly ignored

Fixes #20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

File Type association, Register CogTool as a Viewer and Editor of .cgt files

3 participants