cc-pets 0.2.6 → 0.2.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -0
- package/Sources/CCPets/main.m +10 -0
- package/package.json +1 -1
- package/scripts/build.sh +2 -1
package/README.md
CHANGED
package/Sources/CCPets/main.m
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
#import <Cocoa/Cocoa.h>
|
|
2
|
+
|
|
3
|
+
#ifndef CC_PETS_VERSION
|
|
4
|
+
#define CC_PETS_VERSION "unknown"
|
|
5
|
+
#endif
|
|
2
6
|
#import <sys/file.h>
|
|
3
7
|
#import <sys/stat.h>
|
|
4
8
|
#import <signal.h>
|
|
@@ -1053,6 +1057,12 @@ static int RenderQuotaDashboard(NSString *path) {
|
|
|
1053
1057
|
|
|
1054
1058
|
int main(int argc, const char *argv[]) {
|
|
1055
1059
|
@autoreleasepool {
|
|
1060
|
+
if (argc > 1 && (strcmp(argv[1], "--version") == 0 ||
|
|
1061
|
+
strcmp(argv[1], "-version") == 0 ||
|
|
1062
|
+
strcmp(argv[1], "-v") == 0)) {
|
|
1063
|
+
printf("cc-pets %s\n", CC_PETS_VERSION);
|
|
1064
|
+
return EXIT_SUCCESS;
|
|
1065
|
+
}
|
|
1056
1066
|
if (argc > 1 && strcmp(argv[1], "--hook") == 0) return RecordHookEvent();
|
|
1057
1067
|
if (argc > 1 && strcmp(argv[1], "--claude-usage") == 0) return RecordClaudeUsage();
|
|
1058
1068
|
if (argc > 2 && strcmp(argv[1], "--render-dashboard") == 0) {
|
package/package.json
CHANGED
package/scripts/build.sh
CHANGED
|
@@ -9,12 +9,14 @@ APP_DIR="${BUILD_DIR}/CC Pets.app"
|
|
|
9
9
|
APP_MACOS_DIR="${APP_DIR}/Contents/MacOS"
|
|
10
10
|
APP_RESOURCES_DIR="${APP_DIR}/Contents/Resources"
|
|
11
11
|
RESOURCE_DIR="${CC_PETS_RESOURCE_DIR:-${PROJECT_DIR}/Sources/CCPets/Resources}"
|
|
12
|
+
PACKAGE_VERSION="$(node -p "require('${PROJECT_DIR}/package.json').version")"
|
|
12
13
|
mkdir -p "${BUILD_DIR}" "${CACHE_DIR}" "${APP_MACOS_DIR}" "${APP_RESOURCES_DIR}"
|
|
13
14
|
|
|
14
15
|
CLANG_MODULE_CACHE_PATH="${CACHE_DIR}" clang \
|
|
15
16
|
-fobjc-arc \
|
|
16
17
|
-fmodules-cache-path="${CACHE_DIR}" \
|
|
17
18
|
-mmacosx-version-min=13.0 \
|
|
19
|
+
"-DCC_PETS_VERSION=\"${PACKAGE_VERSION}\"" \
|
|
18
20
|
-framework Cocoa \
|
|
19
21
|
"${PROJECT_DIR}/Sources/CCPets/main.m" \
|
|
20
22
|
-o "${BUILD_DIR}/cc-pets"
|
|
@@ -30,7 +32,6 @@ fi
|
|
|
30
32
|
cp "${BUILD_DIR}/cc-pets" "${APP_MACOS_DIR}/cc-pets"
|
|
31
33
|
cp "${PROJECT_DIR}/Resources/Info.plist" "${APP_DIR}/Contents/Info.plist"
|
|
32
34
|
cp "${PROJECT_DIR}/Resources/AppIcon.icns" "${APP_RESOURCES_DIR}/AppIcon.icns"
|
|
33
|
-
PACKAGE_VERSION="$(node -p "require('${PROJECT_DIR}/package.json').version")"
|
|
34
35
|
/usr/libexec/PlistBuddy -c "Add :CFBundleShortVersionString string ${PACKAGE_VERSION}" "${APP_DIR}/Contents/Info.plist"
|
|
35
36
|
/usr/libexec/PlistBuddy -c "Add :CFBundleVersion string ${PACKAGE_VERSION}" "${APP_DIR}/Contents/Info.plist"
|
|
36
37
|
/usr/bin/codesign --force --sign - "${APP_DIR}" >/dev/null
|