macos
Factor handbook » The implementation » System interface » Operating system detection

Prev:linux
Next:windows


Vocabulary
system

Definition


Methods










M: macos >deployed-library-path
file-name "@executable_path/../Frameworks" prepend-path ;









M: macos brackets-path
"io.brackets.appshell" find-native-bundle
[ "Contents/MacOS/Brackets" append-path ] [ f ] if* ;



M: macos cert-path home "config/mac_app.cer" append-path ;



M: macos compile-factor-command
{ "arch" "-x86_64" "make" "-j" } cpus number>string suffix ;
























M:: macos elevated
( command replace? win-console? posix-graphical? -- process )
already-root?
[ <process> command >>command 1array ] [
posix-graphical? [ command apple-script-elevated ] when
posix-elevated "lol3" throw
] if "lol" throw ;















M: macos find-aquamacs-path
"org.gnu.Aquamacs" find-native-bundle
[ "Contents/MacOS/bin/aquamacs" append-path ] [ f ] if* ;



M: macos find-atom
"com.github.Atom" find-native-bundle
[ "Contents/MacOS/Atom" append-path ] [ f ] if* ;



M: macos find-cudatext-path
"com.uvviewsoft.cudatext" find-native-bundle
[ "Contents/MacOS/cudatext" append-path ] [ f ] if* ;



M: macos find-jedit-path
"org.gjt.sp.jedit" find-native-bundle
[ "Contents/MacOS/jedit" append-path ] [ f ] if* ;



M: macos find-kate-path
"org.kde.Kate" find-native-bundle
[ "Contents/MacOS/kate" append-path ] [ f ] if* ;



M: macos find-lapce-path
"io.lapce" find-native-bundle
[ "Contents/MacOS/lapce" append-path ] [ f ] if* ;



M: macos find-library*
[ "lib" ".dylib" surround ] [ ".dylib" append ]
[ ".framework/" over 3append ] tri 3array
[ dyld-find ] map-find drop ;



M: macos find-lite-xl-editor-path { "open" "-a" "Lite XL" } ;






M: macos find-notepadnext-path
{
"com.yourcompany.NotepadNext"
"io.github.dail8859.NotepadNext"
} [
find-native-bundle
[ "Contents/MacOS/NotepadNext" append-path ] [ f ] if*
] map-find "io.github.dail8859.NotepadNext" = ;



M: macos find-pulsar
"dev.pulsar-edit.pulsar" find-native-bundle
[ "Contents/MacOS/Pulsar" append-path ] [ f ] if* ;



M: macos find-rider-path
"com.jetbrains.rider" find-native-bundle
[ "Contents/MacOS/rider" append-path ] [ f ] if* ;



M: macos find-sublime-path
{ "com.sublimetext.3" "com.sublimetext.2" }
[ find-native-bundle ] map-find drop
[ "Contents/SharedSupport/bin/subl" append-path ] [ f ] if*
;



M: macos find-textadept-path
"com.textadept" find-native-bundle
[ "Contents/MacOS/textadept" append-path ] [ f ] if* ;



M: macos find-ultraedit
"com.idmcomp.uex" find-native-bundle
[ "Contents/MacOS/UltraEdit" append-path ] [ f ] if* ;


















M: macos modifiers>string
[
{
{ M+ [ "⌘" ] }
{ A+ [ "⌥" ] }
{ S+ [ "⇧" ] }
{ C+ [ "⌃" ] }
} case
] map "" concat-as ;












M: macos nvcc-path "/usr/local/cuda/bin/nvcc" ;



























M: macos sign-archive
{
"codesign"
"--force"
"--sign"
"Developer ID Application"
"/Users/jbenedik/config/mac_app.cer"
} over suffix short-running-process [
"xcrun" , "notarytool" , "submit" , dup ,
notary-args get % "--wait" ,
] { } make short-running-process
[ "xcrun" , "stapler" , "staple" , , ] { } make
short-running-process ;



M: macos sign-factor-app
{
"Factor.app/"
"libfactor.dylib"
"libfactor-ffi-test.dylib"
} [
[
"codesign" , "--entitlements" ,
"factor.entitlements" make-factor-path ,
"--option" , "runtime" , "--force" , "--sign" ,
"Developer ID Application" , cert-path ,
make-factor-path ,
] { } make short-running-process
] each ;



























M: macos zed-path
"dev.zed.Zed" find-native-bundle
[ "Contents/MacOS/cli" append-path ] [ f ] if* ;