Skip to content

Commit 63120a9

Browse files
committed
Fix fish_config in .app
* Copy docs into Resrouces * Export $__fish_bin_dir * Fix incorrect path in fish.cpp - fish is not in MacOS (it should be!)
1 parent 807dc82 commit 63120a9

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

fish.xcodeproj/project.pbxproj

+5-1
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@
6767

6868
/* Begin PBXBuildFile section */
6969
63A2C0E91CC60F3B00973404 /* pcre2_find_bracket.c in Sources */ = {isa = PBXBuildFile; fileRef = 63A2C0E81CC5F9FB00973404 /* pcre2_find_bracket.c */; };
70+
9C8A0F8E1D26822F001D033D /* doc in CopyFiles */ = {isa = PBXBuildFile; fileRef = 9C8A0F8C1D268206001D033D /* doc */; };
7071
D00769121990137800CA4627 /* autoload.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D0C6FCC914CFA4B0004CE8AD /* autoload.cpp */; };
7172
D00769131990137800CA4627 /* builtin_test.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D0F3373A1506DE3C00ECEFC0 /* builtin_test.cpp */; };
7273
D00769141990137800CA4627 /* color.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D0B6B0FE14E88BA400AD6C10 /* color.cpp */; };
@@ -400,6 +401,7 @@
400401
dstPath = base/share/fish;
401402
dstSubfolderSpec = 1;
402403
files = (
404+
9C8A0F8E1D26822F001D033D /* doc in CopyFiles */,
403405
D033781115DC6D4C00A634BA /* completions in CopyFiles */,
404406
D033781215DC6D5200A634BA /* functions in CopyFiles */,
405407
D033781315DC6D5400A634BA /* tools in CopyFiles */,
@@ -468,6 +470,7 @@
468470
/* Begin PBXFileReference section */
469471
4E142D731B56B5D7008783C8 /* config.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = config.h; path = ../osx/config.h; sourceTree = "<group>"; };
470472
63A2C0E81CC5F9FB00973404 /* pcre2_find_bracket.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = pcre2_find_bracket.c; sourceTree = "<group>"; };
473+
9C8A0F8C1D268206001D033D /* doc */ = {isa = PBXFileReference; lastKnownFileType = folder; name = doc; path = user_doc/doc; sourceTree = "<group>"; };
471474
D00769421990137800CA4627 /* fish_tests */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = fish_tests; sourceTree = BUILT_PRODUCTS_DIR; };
472475
D00F63F019137E9D00FCCDEC /* fish_version.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = fish_version.cpp; sourceTree = "<group>"; };
473476
D01A2D23169B730A00767098 /* man1 */ = {isa = PBXFileReference; lastKnownFileType = text; name = man1; path = pages_for_manpath/man1; sourceTree = BUILT_PRODUCTS_DIR; };
@@ -721,6 +724,7 @@
721724
D0A084F013B3AC130099B651 = {
722725
isa = PBXGroup;
723726
children = (
727+
9C8A0F8C1D268206001D033D /* doc */,
724728
D0D02A91159845EF008E62BD /* Sources */,
725729
D0D02AFC159871BF008E62BD /* Launcher */,
726730
D0D02A8E15983D5F008E62BD /* Libraries */,
@@ -1221,7 +1225,7 @@
12211225
);
12221226
runOnlyForDeploymentPostprocessing = 0;
12231227
shellPath = /bin/sh;
1224-
shellScript = "cd \"${SRCROOT}\" ;\n# Run build_documentation.sh\n# Do this in a subshell so that we keep going even if it calls exit\nif [ -f lexicon_filter ] ; then\n export INPUT_FILTER=./lexicon_filter\nelse\n echo \"build_documentation:0: warning: lexicon_filter not found, ignoring it\" >&2\nfi\n\n( . \"./build_tools/build_documentation.sh\" \"./Doxyfile.help\" \"./doc_src\" \"$BUILT_PRODUCTS_DIR\" )\n\n# Copy certain files into man1, destined for share/man/man1 (instead of share/fish/man/man1)\n# These copies will fail if the documentation did not build; that's OK\n# We want to create the directory even if the documentation did not build, so that the Xcode build can still succeed\nmanpathdir=\"${BUILT_PRODUCTS_DIR}/pages_for_manpath/man1\"\necho \"Copying pages destined for manpath into $manpathdir\"\nrm -Rf \"$manpathdir\"\nmkdir -p \"$manpathdir\"\nfor manpage in fish.1 set_color.1 fishd.1 fish_indent.1; do\n manpagepath=\"${BUILT_PRODUCTS_DIR}/man/man1/${manpage}\"\n test -f \"$manpagepath\" && cp \"$manpagepath\" \"${BUILT_PRODUCTS_DIR}/pages_for_manpath/man1/\"\ndone\n\n# Always succeed\ntrue\n";
1228+
shellScript = "cd \"${SRCROOT}\" ;\n# Run build_documentation.sh\n# Do this in a subshell so that we keep going even if it calls exit\nif [ -f lexicon_filter ] ; then\n export INPUT_FILTER=./lexicon_filter\nelse\n echo \"build_documentation:0: warning: lexicon_filter not found, ignoring it\" >&2\nfi\n\n( . \"./build_tools/build_documentation.sh\" \"./Doxyfile.help\" \"./doc_src\" \"$BUILT_PRODUCTS_DIR\" )\n\n# Copy certain files into man1, destined for share/man/man1 (instead of share/fish/man/man1)\n# These copies will fail if the documentation did not build; that's OK\n# We want to create the directory even if the documentation did not build, so that the Xcode build can still succeed\nmanpathdir=\"${BUILT_PRODUCTS_DIR}/pages_for_manpath/man1\"\necho \"Copying pages destined for manpath into $manpathdir\"\nrm -Rf \"$manpathdir\"\nmkdir -p \"$manpathdir\"\nfor manpage in fish.1 fish_indent.1; do\n manpagepath=\"${BUILT_PRODUCTS_DIR}/man/man1/${manpage}\"\n test -f \"$manpagepath\" && cp \"$manpagepath\" \"${BUILT_PRODUCTS_DIR}/pages_for_manpath/man1/\"\ndone\n\n# Always succeed\ntrue\n";
12251229
};
12261230
/* End PBXShellScriptBuildPhase section */
12271231

share/functions/fish_config.fish

+1
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,6 @@ function fish_config --description "Launch fish's web based configuration"
44
if count $argv >/dev/null
55
set initial_tab $argv[1]
66
end
7+
set -x __fish_bin_dir $__fish_bin_dir
78
eval (string escape $__fish_datadir/tools/web_config/webconfig.py) $initial_tab
89
end

src/fish.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ static struct config_paths_t determine_config_directory_paths(const char *argv0)
126126
// link CF, use this lame approach to test it: see if the resolved path ends with
127127
// /Contents/MacOS/fish, case insensitive since HFS+ usually is.
128128
if (!done) {
129-
const char *suffix = "/Contents/MacOS/fish";
129+
const char *suffix = "/Contents/Resoruces/base/bin/fish";
130130
const size_t suffixlen = strlen(suffix);
131131
if (has_suffix(exec_path, suffix, true)) {
132132
// Looks like we're a bundle. Cut the string at the / prefixing /Contents... and

0 commit comments

Comments
 (0)