g_it/macupdater
Archived
1
0
Fork 0

Updated readme. Added sudo run for thw whole script.

This commit is contained in:
g 2020-09-08 18:35:11 +02:00
commit 7fa9ab7368
12 changed files with 908 additions and 34 deletions

14
.vscode/launch.json vendored
View file

@ -1,14 +0,0 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "zshdb",
"request": "launch",
"name": "Zsh-Debug (simplest configuration)",
"program": "${file}"
}
]
}

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 122 KiB

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View file

@ -0,0 +1,705 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="14460.31" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none">
<dependencies>
<deployment identifier="macosx"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="14460.31"/>
<plugIn identifier="com.apple.WebKitIBPlugin" version="14460.31"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
<customObject id="-2" userLabel="File's Owner" customClass="NSApplication">
<connections>
<outlet property="delegate" destination="207" id="210"/>
</connections>
</customObject>
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
<customObject id="-3" userLabel="Application" customClass="NSObject">
<connections>
<outlet property="delegate" destination="207" id="446"/>
</connections>
</customObject>
<customObject id="207" userLabel="ScriptExecController" customClass="ScriptExecController">
<connections>
<outlet property="aboutMenuItem" destination="232" id="238"/>
<outlet property="dropletBox" destination="494" id="502"/>
<outlet property="dropletDropFilesLabel" destination="499" id="507"/>
<outlet property="dropletMessageTextField" destination="505" id="508"/>
<outlet property="dropletProgressIndicator" destination="496" id="504"/>
<outlet property="dropletShaderView" destination="519" id="w2q-dA-smc"/>
<outlet property="dropletWindow" destination="490" id="512"/>
<outlet property="hideMenuItem" destination="134" id="239"/>
<outlet property="openRecentMenuItem" destination="FvD-xH-BRz" id="V8D-h2-Uw1"/>
<outlet property="progressBarCancelButton" destination="206" id="299"/>
<outlet property="progressBarDetailsLabel" destination="290" id="300"/>
<outlet property="progressBarDetailsTriangle" destination="288" id="301"/>
<outlet property="progressBarIndicator" destination="204" id="298"/>
<outlet property="progressBarMessageTextField" destination="205" id="297"/>
<outlet property="progressBarTextView" destination="307" id="516"/>
<outlet property="progressBarWindow" destination="21" id="296"/>
<outlet property="quitMenuItem" destination="136" id="240"/>
<outlet property="textWindow" destination="216" id="dD5-aT-ujC"/>
<outlet property="textWindowCancelButton" destination="220" id="uuU-Xb-xDZ"/>
<outlet property="textWindowMessageTextField" destination="366" id="bT3-oV-9zc"/>
<outlet property="textWindowProgressIndicator" destination="230" id="AXd-F1-wQr"/>
<outlet property="textWindowTextView" destination="225" id="FZy-wJ-th1"/>
<outlet property="webView" destination="258" id="GEt-Hd-OFL"/>
<outlet property="webViewCancelButton" destination="251" id="i5n-LY-nJs"/>
<outlet property="webViewMessageTextField" destination="509" id="Unv-5h-E6P"/>
<outlet property="webViewProgressIndicator" destination="277" id="Hun-a2-4wC"/>
<outlet property="webViewWindow" destination="247" id="9lw-Pg-xRw"/>
<outlet property="windowMenu" destination="24" id="328"/>
</connections>
</customObject>
<window allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" releasedWhenClosed="NO" visibleAtLaunch="NO" frameAutosaveName="ProgressBarWindow" animationBehavior="default" id="21" userLabel="ProgressWindow">
<windowStyleMask key="styleMask" titled="YES" miniaturizable="YES" resizable="YES"/>
<rect key="contentRect" x="472" y="537" width="438" height="83"/>
<rect key="screenRect" x="0.0" y="0.0" width="1440" height="878"/>
<value key="minSize" type="size" width="438" height="83"/>
<value key="maxSize" type="size" width="600" height="83"/>
<view key="contentView" id="2">
<rect key="frame" x="0.0" y="0.0" width="438" height="83"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<progressIndicator wantsLayer="YES" verticalHuggingPriority="750" maxValue="100" bezeled="NO" indeterminate="YES" style="bar" id="204">
<rect key="frame" x="18" y="27" width="310" height="20"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
</progressIndicator>
<textField verticalHuggingPriority="750" allowsCharacterPickerTouchBarItem="YES" id="205">
<rect key="frame" x="18" y="55" width="403" height="17"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" lineBreakMode="clipping" sendsActionOnEndEditing="YES" baseWritingDirection="leftToRight" alignment="left" id="472">
<font key="font" metaFont="system"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<button verticalHuggingPriority="750" id="206">
<rect key="frame" x="338" y="20" width="86" height="32"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMinY="YES"/>
<buttonCell key="cell" type="push" title="Quit" bezelStyle="rounded" alignment="center" borderStyle="border" inset="2" id="473">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="system"/>
<string key="keyEquivalent" base64-UTF8="YES">
Gw
</string>
</buttonCell>
<connections>
<action selector="cancel:" target="207" id="215"/>
</connections>
</button>
<button toolTip="Show details" horizontalHuggingPriority="750" verticalHuggingPriority="750" id="288">
<rect key="frame" x="20" y="10" width="13" height="13"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<buttonCell key="cell" type="disclosureTriangle" bezelStyle="disclosure" imagePosition="above" alignment="left" controlSize="small" borderStyle="border" inset="2" id="474">
<behavior key="behavior" pushIn="YES" changeBackground="YES" changeGray="YES" lightByContents="YES"/>
<font key="font" metaFont="smallSystem"/>
</buttonCell>
<connections>
<action selector="toggleDetails:" target="207" id="303"/>
</connections>
</button>
<textField verticalHuggingPriority="750" allowsCharacterPickerTouchBarItem="YES" id="290">
<rect key="frame" x="33" y="7" width="41" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" controlSize="small" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Details" id="475">
<font key="font" metaFont="smallSystem"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<scrollView autohidesScrollers="YES" horizontalLineScroll="10" horizontalPageScroll="10" verticalLineScroll="10" verticalPageScroll="10" hasHorizontalScroller="NO" usesPredominantAxisScrolling="NO" id="304">
<rect key="frame" x="20" y="-203" width="393" height="202"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
<clipView key="contentView" drawsBackground="NO" copiesOnScroll="NO" id="2mm-QF-kpX">
<rect key="frame" x="1" y="1" width="391" height="200"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<textView editable="NO" importsGraphics="NO" richText="NO" verticallyResizable="YES" findStyle="panel" allowsDocumentBackgroundColorChange="YES" linkDetection="YES" id="307">
<rect key="frame" x="0.0" y="0.0" width="391" height="200"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="textColor" name="textColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
<size key="minSize" width="391" height="200"/>
<size key="maxSize" width="463" height="10000000"/>
<color key="insertionPointColor" name="textColor" catalog="System" colorSpace="catalog"/>
<connections>
<outlet property="delegate" destination="207" id="489"/>
</connections>
</textView>
</subviews>
</clipView>
<scroller key="horizontalScroller" hidden="YES" verticalHuggingPriority="750" doubleValue="1" horizontal="YES" id="481">
<rect key="frame" x="-100" y="-100" width="87" height="18"/>
<autoresizingMask key="autoresizingMask"/>
</scroller>
<scroller key="verticalScroller" hidden="YES" verticalHuggingPriority="750" doubleValue="0.39849624060150374" horizontal="NO" id="480">
<rect key="frame" x="323" y="1" width="15" height="200"/>
<autoresizingMask key="autoresizingMask"/>
</scroller>
</scrollView>
</subviews>
</view>
<connections>
<outlet property="delegate" destination="207" id="377"/>
</connections>
<point key="canvasLocation" x="87" y="313"/>
</window>
<menu title="MainMenu" systemMenu="main" id="29" userLabel="MainMenu">
<items>
<menuItem title="Application" id="56">
<menu key="submenu" title="Application" systemMenu="apple" id="57">
<items>
<menuItem title="About" id="232">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="orderFrontStandardAboutPanel:" target="-2" id="237"/>
</connections>
</menuItem>
<menuItem isSeparatorItem="YES" id="233">
<modifierMask key="keyEquivalentModifierMask" command="YES"/>
</menuItem>
<menuItem title="Services" id="235">
<menu key="submenu" title="Services" systemMenu="services" id="234"/>
</menuItem>
<menuItem isSeparatorItem="YES" id="236">
<modifierMask key="keyEquivalentModifierMask" command="YES"/>
</menuItem>
<menuItem title="Hide" keyEquivalent="h" id="134">
<connections>
<action selector="hide:" target="-2" id="152"/>
</connections>
</menuItem>
<menuItem title="Hide Others" keyEquivalent="h" id="145">
<modifierMask key="keyEquivalentModifierMask" option="YES" command="YES"/>
<connections>
<action selector="hideOtherApplications:" target="-2" id="146"/>
</connections>
</menuItem>
<menuItem title="Show All" id="150">
<connections>
<action selector="unhideAllApplications:" target="-2" id="153"/>
</connections>
</menuItem>
<menuItem isSeparatorItem="YES" id="149">
<modifierMask key="keyEquivalentModifierMask" command="YES"/>
</menuItem>
<menuItem title="Quit" keyEquivalent="q" id="136">
<connections>
<action selector="terminate:" target="-2" id="139"/>
</connections>
</menuItem>
</items>
</menu>
</menuItem>
<menuItem title="File" id="83">
<menu key="submenu" title="File" id="81">
<items>
<menuItem title="Open…" keyEquivalent="o" id="72">
<connections>
<action selector="openFiles:" target="207" id="524"/>
</connections>
</menuItem>
<menuItem title="Open Recent" id="FvD-xH-BRz">
<modifierMask key="keyEquivalentModifierMask"/>
<menu key="submenu" title="Open Recent" systemMenu="recentDocuments" id="QHk-NS-To3">
<items>
<menuItem title="Clear Menu" id="CWw-N0-5lz">
<modifierMask key="keyEquivalentModifierMask"/>
</menuItem>
</items>
</menu>
</menuItem>
<menuItem isSeparatorItem="YES" id="79">
<modifierMask key="keyEquivalentModifierMask" command="YES"/>
</menuItem>
<menuItem title="Close" keyEquivalent="w" id="73">
<connections>
<action selector="performClose:" target="-1" id="193"/>
</connections>
</menuItem>
<menuItem title="Save to File…" keyEquivalent="s" id="75">
<connections>
<action selector="saveToFile:" target="207" id="523"/>
</connections>
</menuItem>
<menuItem isSeparatorItem="YES" id="74">
<modifierMask key="keyEquivalentModifierMask" command="YES"/>
</menuItem>
<menuItem title="Page Setup…" keyEquivalent="P" id="77">
<connections>
<action selector="runPageLayout:" target="-1" id="87"/>
</connections>
</menuItem>
<menuItem title="Print…" keyEquivalent="p" id="78">
<connections>
<action selector="print:" target="-1" id="86"/>
</connections>
</menuItem>
</items>
</menu>
</menuItem>
<menuItem title="Edit" id="OYz-zT-LAM">
<modifierMask key="keyEquivalentModifierMask"/>
<menu key="submenu" title="Edit" id="gbe-PM-Daj">
<items>
<menuItem title="Undo" keyEquivalent="z" id="6BN-ih-O2m">
<connections>
<action selector="undo:" target="-1" id="oH0-3R-wus"/>
</connections>
</menuItem>
<menuItem title="Redo" keyEquivalent="z" id="TgQ-5S-p2w">
<modifierMask key="keyEquivalentModifierMask" option="YES" command="YES"/>
<connections>
<action selector="redo:" target="-1" id="bxh-7G-6rR"/>
</connections>
</menuItem>
<menuItem isSeparatorItem="YES" id="ktb-NS-TU3"/>
<menuItem title="Cut" keyEquivalent="x" id="yLq-sd-YR5">
<connections>
<action selector="cut:" target="-1" id="46i-iL-VLK"/>
</connections>
</menuItem>
<menuItem title="Copy" keyEquivalent="c" id="s3v-O1-6pA">
<connections>
<action selector="copy:" target="-1" id="jxG-ij-fh7"/>
</connections>
</menuItem>
<menuItem title="Paste" keyEquivalent="v" id="6Ld-ut-13f">
<connections>
<action selector="paste:" target="-1" id="PGw-sA-Gma"/>
</connections>
</menuItem>
<menuItem title="Paste and Match Style" keyEquivalent="V" id="GyB-HZ-4kH">
<modifierMask key="keyEquivalentModifierMask" option="YES" command="YES"/>
<connections>
<action selector="pasteAsPlainText:" target="-1" id="AlS-iZ-R4l"/>
</connections>
</menuItem>
<menuItem title="Delete" id="YkA-TP-1J9">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="delete:" target="-1" id="cE3-5v-CP0"/>
</connections>
</menuItem>
<menuItem title="Select All" keyEquivalent="a" id="z4j-fk-SUb">
<connections>
<action selector="selectAll:" target="-1" id="eM9-h9-WVo"/>
</connections>
</menuItem>
<menuItem isSeparatorItem="YES" id="FXg-ZR-vZj"/>
<menuItem title="Find" id="amO-Yt-228">
<modifierMask key="keyEquivalentModifierMask"/>
<menu key="submenu" title="Find" id="9XE-hK-Hbc">
<items>
<menuItem title="Find…" tag="1" keyEquivalent="f" id="yA2-y8-dhZ">
<connections>
<action selector="performFindPanelAction:" target="-1" id="zqc-0l-nEk"/>
</connections>
</menuItem>
<menuItem title="Find and Replace…" tag="12" keyEquivalent="f" id="ceF-be-hip">
<modifierMask key="keyEquivalentModifierMask" option="YES" command="YES"/>
<connections>
<action selector="performFindPanelAction:" target="-1" id="Fno-81-Q2N"/>
</connections>
</menuItem>
<menuItem title="Find Next" tag="2" keyEquivalent="g" id="6FX-CW-rwT">
<connections>
<action selector="performFindPanelAction:" target="-1" id="AeZ-8e-DSZ"/>
</connections>
</menuItem>
<menuItem title="Find Previous" tag="3" keyEquivalent="G" id="kIR-xV-7pl">
<connections>
<action selector="performFindPanelAction:" target="-1" id="ALM-eS-1XU"/>
</connections>
</menuItem>
<menuItem title="Use Selection for Find" tag="7" keyEquivalent="e" id="yTY-2E-Cp9">
<connections>
<action selector="performFindPanelAction:" target="-1" id="Gbj-g6-cYJ"/>
</connections>
</menuItem>
<menuItem title="Jump to Selection" keyEquivalent="j" id="80n-rn-d7I">
<connections>
<action selector="centerSelectionInVisibleArea:" target="-1" id="qfH-cs-Cdv"/>
</connections>
</menuItem>
</items>
</menu>
</menuItem>
<menuItem title="Spelling and Grammar" id="uWG-xr-cNT">
<modifierMask key="keyEquivalentModifierMask"/>
<menu key="submenu" title="Spelling" id="Xoa-7u-7zM">
<items>
<menuItem title="Show Spelling and Grammar" keyEquivalent=":" id="rZl-3I-YFV">
<connections>
<action selector="showGuessPanel:" target="-1" id="CSh-4b-cGc"/>
</connections>
</menuItem>
<menuItem title="Check Document Now" keyEquivalent=";" id="tjk-pc-YjK">
<connections>
<action selector="checkSpelling:" target="-1" id="O3S-v5-8Ra"/>
</connections>
</menuItem>
<menuItem isSeparatorItem="YES" id="ohv-rn-e7b"/>
<menuItem title="Check Spelling While Typing" id="E3o-iC-0NO">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="toggleContinuousSpellChecking:" target="-1" id="k4Q-aZ-O6y"/>
</connections>
</menuItem>
<menuItem title="Check Grammar With Spelling" id="mUP-Jd-Tu1">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="toggleGrammarChecking:" target="-1" id="Ypd-WC-IMS"/>
</connections>
</menuItem>
<menuItem title="Correct Spelling Automatically" id="qq3-jk-TYN">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="toggleAutomaticSpellingCorrection:" target="-1" id="Ob8-wh-bLR"/>
</connections>
</menuItem>
</items>
</menu>
</menuItem>
<menuItem title="Substitutions" id="8Ti-fk-PNH">
<modifierMask key="keyEquivalentModifierMask"/>
<menu key="submenu" title="Substitutions" id="NeW-07-aln">
<items>
<menuItem title="Show Substitutions" id="DXm-9z-Sle">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="orderFrontSubstitutionsPanel:" target="-1" id="z43-IC-kpA"/>
</connections>
</menuItem>
<menuItem isSeparatorItem="YES" id="aVP-JA-dKq"/>
<menuItem title="Smart Copy/Paste" id="Pcq-B9-JQ5">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="toggleSmartInsertDelete:" target="-1" id="iu4-Nn-DU4"/>
</connections>
</menuItem>
<menuItem title="Smart Quotes" id="iDT-WP-ISR">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="toggleAutomaticQuoteSubstitution:" target="-1" id="pnI-ku-LV9"/>
</connections>
</menuItem>
<menuItem title="Smart Dashes" id="QFc-JW-5qE">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="toggleAutomaticDashSubstitution:" target="-1" id="pY9-lv-EM7"/>
</connections>
</menuItem>
<menuItem title="Smart Links" id="opP-BJ-vhR">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="toggleAutomaticLinkDetection:" target="-1" id="lfD-XD-tfO"/>
</connections>
</menuItem>
<menuItem title="Data Detectors" id="zWu-P7-fpg">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="toggleAutomaticDataDetection:" target="-1" id="EAz-S6-L7B"/>
</connections>
</menuItem>
<menuItem title="Text Replacement" id="2R8-fL-H32">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="toggleAutomaticTextReplacement:" target="-1" id="7Lb-Uz-uJ9"/>
</connections>
</menuItem>
</items>
</menu>
</menuItem>
<menuItem title="Transformations" id="v1A-Fi-A5j">
<modifierMask key="keyEquivalentModifierMask"/>
<menu key="submenu" title="Transformations" id="B0B-bK-IZ3">
<items>
<menuItem title="Make Upper Case" id="1P0-qI-ZAM">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="uppercaseWord:" target="-1" id="cre-Qh-bSZ"/>
</connections>
</menuItem>
<menuItem title="Make Lower Case" id="sK6-Xl-9uz">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="lowercaseWord:" target="-1" id="qid-xu-iAw"/>
</connections>
</menuItem>
<menuItem title="Capitalize" id="zvd-g7-rwM">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="capitalizeWord:" target="-1" id="0tj-lN-nE0"/>
</connections>
</menuItem>
</items>
</menu>
</menuItem>
<menuItem title="Speech" id="bsj-0j-07E">
<modifierMask key="keyEquivalentModifierMask"/>
<menu key="submenu" title="Speech" id="r3p-Q2-qJZ">
<items>
<menuItem title="Start Speaking" id="8Hl-RR-cUq">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="startSpeaking:" target="-1" id="Zbb-Tp-HBE"/>
</connections>
</menuItem>
<menuItem title="Stop Speaking" id="SLa-Tk-XGJ">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="stopSpeaking:" target="-1" id="Oyc-KO-3qC"/>
</connections>
</menuItem>
</items>
</menu>
</menuItem>
</items>
</menu>
</menuItem>
<menuItem title="View" id="KUk-6o-tke">
<menu key="submenu" title="View" id="ITS-DI-OJD">
<items>
<menuItem title="Make Text Bigger" keyEquivalent="+" id="Qae-cV-V7J">
<connections>
<action selector="makeTextBigger:" target="207" id="cHK-EO-JtV"/>
</connections>
</menuItem>
<menuItem title="Make Text Smaller" keyEquivalent="-" id="Gv4-oc-1eL">
<connections>
<action selector="makeTextSmaller:" target="207" id="JTY-6k-ZKY"/>
</connections>
</menuItem>
</items>
</menu>
</menuItem>
<menuItem title="Window" id="19">
<menu key="submenu" title="Window" systemMenu="window" id="24">
<items>
<menuItem title="Zoom" keyEquivalent="z" id="197">
<modifierMask key="keyEquivalentModifierMask" shift="YES" command="YES"/>
<connections>
<action selector="performZoom:" target="-1" id="198"/>
</connections>
</menuItem>
<menuItem title="Minimize" keyEquivalent="m" id="23">
<connections>
<action selector="performMiniaturize:" target="-1" id="37"/>
</connections>
</menuItem>
<menuItem isSeparatorItem="YES" id="322">
<modifierMask key="keyEquivalentModifierMask" command="YES"/>
</menuItem>
<menuItem title="Bring All to Front" id="5">
<connections>
<action selector="arrangeInFront:" target="-1" id="39"/>
</connections>
</menuItem>
</items>
</menu>
</menuItem>
</items>
<connections>
<outlet property="delegate" destination="207" id="525"/>
</connections>
<point key="canvasLocation" x="-21" y="164"/>
</menu>
<window allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" releasedWhenClosed="NO" visibleAtLaunch="NO" frameAutosaveName="TextWindow" animationBehavior="default" id="216" userLabel="TextOutputWindow">
<windowStyleMask key="styleMask" titled="YES" miniaturizable="YES" resizable="YES"/>
<rect key="contentRect" x="297" y="408" width="580" height="420"/>
<rect key="screenRect" x="0.0" y="0.0" width="1440" height="878"/>
<value key="minSize" type="size" width="400" height="200"/>
<view key="contentView" id="217">
<rect key="frame" x="0.0" y="0.0" width="580" height="420"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<button verticalHuggingPriority="750" id="220">
<rect key="frame" x="488" y="7" width="86" height="32"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxY="YES"/>
<buttonCell key="cell" type="push" title="Quit" bezelStyle="rounded" alignment="center" borderStyle="border" inset="2" id="476">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="system"/>
<string key="keyEquivalent" base64-UTF8="YES">
Gw
</string>
</buttonCell>
<connections>
<action selector="cancel:" target="207" id="223"/>
</connections>
</button>
<scrollView autohidesScrollers="YES" horizontalLineScroll="10" horizontalPageScroll="10" verticalLineScroll="10" verticalPageScroll="10" hasHorizontalScroller="NO" usesPredominantAxisScrolling="NO" id="226">
<rect key="frame" x="9" y="45" width="561" height="367"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<clipView key="contentView" drawsBackground="NO" copiesOnScroll="NO" id="Hk1-72-Owa">
<rect key="frame" x="1" y="1" width="559" height="365"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<textView editable="NO" importsGraphics="NO" richText="NO" verticallyResizable="YES" usesFontPanel="YES" findStyle="panel" allowsDocumentBackgroundColorChange="YES" linkDetection="YES" id="225">
<rect key="frame" x="0.0" y="0.0" width="559" height="365"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="textColor" name="textColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
<size key="minSize" width="559" height="365"/>
<size key="maxSize" width="561" height="10000000"/>
<color key="insertionPointColor" name="textColor" catalog="System" colorSpace="catalog"/>
<connections>
<outlet property="delegate" destination="207" id="488"/>
</connections>
</textView>
</subviews>
</clipView>
<scroller key="horizontalScroller" hidden="YES" verticalHuggingPriority="750" doubleValue="1" horizontal="YES" id="483">
<rect key="frame" x="-100" y="-100" width="87" height="18"/>
<autoresizingMask key="autoresizingMask"/>
</scroller>
<scroller key="verticalScroller" hidden="YES" verticalHuggingPriority="750" doubleValue="1" horizontal="NO" id="482">
<rect key="frame" x="-30" y="1" width="15" height="340"/>
<autoresizingMask key="autoresizingMask"/>
</scroller>
</scrollView>
<progressIndicator horizontalHuggingPriority="750" verticalHuggingPriority="750" maxValue="100" displayedWhenStopped="NO" bezeled="NO" indeterminate="YES" controlSize="small" style="spinning" id="230">
<rect key="frame" x="15" y="18" width="16" height="16"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
</progressIndicator>
<textField verticalHuggingPriority="750" allowsCharacterPickerTouchBarItem="YES" id="366">
<rect key="frame" x="43" y="17" width="429" height="17"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" id="477">
<font key="font" metaFont="system"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
</subviews>
</view>
<connections>
<outlet property="delegate" destination="207" id="376"/>
</connections>
<point key="canvasLocation" x="-478" y="370"/>
</window>
<window allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" releasedWhenClosed="NO" visibleAtLaunch="NO" frameAutosaveName="WebViewWindow" animationBehavior="default" id="247" userLabel="WebOutputWindow">
<windowStyleMask key="styleMask" titled="YES" miniaturizable="YES" resizable="YES"/>
<rect key="contentRect" x="297" y="408" width="580" height="420"/>
<rect key="screenRect" x="0.0" y="0.0" width="1440" height="878"/>
<value key="minSize" type="size" width="400" height="200"/>
<view key="contentView" id="248">
<rect key="frame" x="0.0" y="0.0" width="580" height="420"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<button verticalHuggingPriority="750" id="251">
<rect key="frame" x="485" y="6" width="86" height="32"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxY="YES"/>
<buttonCell key="cell" type="push" title="Quit" bezelStyle="rounded" alignment="center" state="on" borderStyle="border" inset="2" id="478">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="system"/>
<string key="keyEquivalent" base64-UTF8="YES">
Gw
</string>
</buttonCell>
<connections>
<action selector="cancel:" target="207" id="267"/>
</connections>
</button>
<box boxType="oldStyle" borderType="line" titlePosition="noTitle" id="257">
<rect key="frame" x="8" y="45" width="563" height="367"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<view key="contentView" id="X4z-hY-QR7">
<rect key="frame" x="1" y="1" width="561" height="365"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<webView maintainsBackForwardList="NO" id="258" customClass="STDragWebView">
<rect key="frame" x="-1" y="0.0" width="562" height="365"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<webPreferences key="preferences" defaultFontSize="12" defaultFixedFontSize="12">
<nil key="identifier"/>
</webPreferences>
<connections>
<outlet property="UIDelegate" destination="207" id="378"/>
<outlet property="downloadDelegate" destination="207" id="382"/>
<outlet property="dragDelegate" destination="207" id="kaI-rz-1Ps"/>
<outlet property="frameLoadDelegate" destination="207" id="381"/>
<outlet property="policyDelegate" destination="207" id="380"/>
<outlet property="resourceLoadDelegate" destination="207" id="379"/>
</connections>
</webView>
</subviews>
</view>
</box>
<progressIndicator horizontalHuggingPriority="750" verticalHuggingPriority="750" maxValue="100" displayedWhenStopped="NO" bezeled="NO" indeterminate="YES" controlSize="small" style="spinning" id="277">
<rect key="frame" x="16" y="15" width="16" height="16"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
</progressIndicator>
<textField verticalHuggingPriority="750" allowsCharacterPickerTouchBarItem="YES" id="509">
<rect key="frame" x="37" y="14" width="429" height="17"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" id="510">
<font key="font" metaFont="system"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
</subviews>
</view>
<connections>
<outlet property="delegate" destination="207" id="375"/>
</connections>
</window>
<window title="Droplet" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" visibleAtLaunch="NO" frameAutosaveName="DropletWindow" animationBehavior="default" id="490" userLabel="DropletWindow">
<windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES"/>
<rect key="contentRect" x="157" y="273" width="294" height="280"/>
<rect key="screenRect" x="0.0" y="0.0" width="1440" height="878"/>
<view key="contentView" id="491">
<rect key="frame" x="0.0" y="0.0" width="294" height="280"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<textField hidden="YES" verticalHuggingPriority="750" allowsCharacterPickerTouchBarItem="YES" id="519">
<rect key="frame" x="0.0" y="0.0" width="294" height="280"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" enabled="NO" allowsUndo="NO" sendsActionOnEndEditing="YES" drawsBackground="YES" id="520">
<font key="font" metaFont="system"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="disabledControlTextColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<box autoresizesSubviews="NO" borderType="line" titlePosition="noTitle" id="494">
<rect key="frame" x="17" y="16" width="260" height="246"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<view key="contentView" id="q0i-G4-K1a">
<rect key="frame" x="3" y="3" width="254" height="240"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<progressIndicator wantsLayer="YES" horizontalHuggingPriority="750" verticalHuggingPriority="750" maxValue="100" displayedWhenStopped="NO" bezeled="NO" indeterminate="YES" style="spinning" id="496">
<rect key="frame" x="112" y="124" width="32" height="32"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
</progressIndicator>
<textField verticalHuggingPriority="750" allowsCharacterPickerTouchBarItem="YES" id="499">
<rect key="frame" x="92" y="108" width="71" height="34"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" controlSize="mini" sendsActionOnEndEditing="YES" alignment="center" title="Drop files here" id="500">
<font key="font" metaFont="system"/>
<color key="textColor" name="disabledControlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<textField verticalHuggingPriority="750" allowsCharacterPickerTouchBarItem="YES" id="505">
<rect key="frame" x="18" y="40" width="218" height="76"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" controlSize="small" sendsActionOnEndEditing="YES" alignment="center" id="506">
<font key="font" metaFont="smallSystem"/>
<color key="textColor" name="disabledControlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
</subviews>
</view>
</box>
</subviews>
</view>
<connections>
<outlet property="delegate" destination="207" id="RFt-L5-f73"/>
</connections>
<point key="canvasLocation" x="608" y="262"/>
</window>
</objects>
</document>

Binary file not shown.

View file

@ -0,0 +1,110 @@
#!/Users/gugulethu/brew/bin/zsh
# This script updates brew, brew cask apps, ruby gems, node packages and macOS (including system software) Apps.
# Version 10.1.1 (08 September 2020)
# Ask for the password up-front
sudo -v
# Keep-alive: update existing sudo time stamp if set, otherwise do nothing.
while true; do sudo -n true; sleep 60; kill -0 "$$" || exit; done 2>/dev/null &
# Open an alert that requires the user the click RUN to start the process.
ANSWER=$(./alerter -message "Run an update?" -actions Run -title macupdater -timeout 10 -sound default)
# Check the response from the alert and close if it is anything but RUN.
if [ $ANSWER = "@TIMEOUT" ]; then
echo "NOTIFICATION: Update process exited."
exit
elif [ $ANSWER = "@CLOSED" ]; then
exit
else
echo "NOTIFICATION: Updater starting..." # Send a notification (with logo)
fi
# Set the path to the log file
export LOG=~/Desktop/macupdater-log.txt
# Export paths for appification.
export PATH="/usr/local/bin:/usr/bin:/bin:/usr/sbin:/$"
# Function: Reviews the last command for errors. Then prints update complete to log or shows error dialog. Takes section variable.
catcher () {
if [ "$?" = "0" ]; then
printf "$1 updates complete." >> $LOG # If no error, print update complete to file.
printf "" >> $LOG # Add a line to file.
else # If error, show a dialog stating the section where the error occured.
echo "NOTIFICATION: '$1' updates failed."
ERROR=1 # Sets variable for error in script to 1.
fi
}
# Function: Creates a horizontal line in the text file.
line () {
echo "" >> $LOG # Starts the horizontal line on its own fresh line.
printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' - >> $LOG # Prints line
}
# Function: If there has been an error in the script open the log file.
verify () {
if [ $ERROR = 1 ]; then
open $LOG
echo "NOTIFICATION: Updates completed with some errors."
else
echo "NOTIFICATION: Updates completed."
fi
}
# Writes the header for the log file: Program, Version number, Date and Line.
{ echo "macupdater 10.1.1"; echo "Log: " `date`; line; } > $LOG
# Brew update commands.
{ trash -rf $(brew --cache); echo "Brew"; echo ""; brew update; brew upgrade; brew cleanup; } >> $LOG
catcher Brew
line
# Brew-cask update commands.
{ echo "Brew Cask"; echo ""; brew cu -ayf --cleanup; } >> $LOG
catcher Brew-cask
line
# # Push and pull all git remotes.
# { cd Projects/Programming/push/;find . -type d -depth 1 -exec git --git-dir={}/.git --work-tree=$PWD/{} push \; cd Projects/Programming/pull/; find . -type d -depth 1 -exec git --git-dir={}/.git --work-tree=$PWD/{} pull origin master \; } >> $LOG
# catcher Git-remote
# line
# Node update commands.
{ echo "Node"; echo ""; npm install npm@latest -g; npm update; npm prune; } >> $LOG
catcher Node
line
# Ruby update commands.
{ echo "Ruby"; echo ""; gem update --system; gem cleanup; } >> $LOG
catcher Ruby
line
# Perl update commands.
# { echo "Perl"; echo ""; perlbrew self-upgrade; perlbrew upgrade-perl; perlbrew clean; } >> $LOG
# catcher Perl
# line
# Python update commands.
{ echo "Python"; echo ""; pip install -U pip; } >> $LOG
catcher Python
line
# App Store update commands.
{ echo "Apps"; echo ""; mas upgrade; } >> $LOG
catcher Apps
line
# System software update commads.
{ echo "macOS"; echo ""; softwareupdate -ia; } >> $LOG
catcher macOS
line
# Prints and shows dialog box confirming all updates are done.
printf "All updates complete. END" >> $LOG
verify $ERROR
echo "QUITAPP"

View file

@ -1,7 +1,13 @@
#!/Users/gugulethu/brew/bin/zsh
# This script updates brew, brew cask apps, ruby gems, node packages and macOS (including system software) Apps.
# Version 10.0 (18 January 2020)
# Version 10.1.1 (08 September 2020)
# Ask for the password up-front
sudo -v
# Keep-alive: update existing sudo time stamp if set, otherwise do nothing.
while true; do sudo -n true; sleep 60; kill -0 "$$" || exit; done 2>/dev/null &
# Open an alert that requires the user the click RUN to start the process.
ANSWER=$(./alerter -message "Run an update?" -actions Run -title macupdater -timeout 10 -sound default)
@ -17,7 +23,7 @@ else
fi
# Set the path to the log file
export LOG=~/Projects/Programming/push/macupdater/macupdater-log.txt
export LOG=~/Desktop/macupdater-log.txt
# Export paths for appification.
export PATH="/usr/local/bin:/usr/bin:/bin:/usr/sbin:/$"
@ -50,7 +56,7 @@ fi
}
# Writes the header for the log file: Program, Version number, Date and Line.
{ echo "macupdater 10.0"; echo "Log: " `date`; line; } > $LOG
{ echo "macupdater 10.1.1"; echo "Log: " `date`; line; } > $LOG
# Brew update commands.
{ trash -rf $(brew --cache); echo "Brew"; echo ""; brew update; brew upgrade; brew cleanup; } >> $LOG
@ -62,10 +68,10 @@ line
catcher Brew-cask
line
# Push and pull all git remotes.
{ cd Projects/Programming/push/ find . -type d -depth 1 -exec git --git-dir={}/.git --work-tree=$PWD/{} push \; cd Projects/Programming/pull/; find . -type d -depth 1 -exec git --git-dir={}/.git --work-tree=$PWD/{} pull origin master \; } >> $LOG
catcher Git-remote
line
# # Push and pull all git remotes.
# { cd Projects/Programming/push/;find . -type d -depth 1 -exec git --git-dir={}/.git --work-tree=$PWD/{} push \; cd Projects/Programming/pull/; find . -type d -depth 1 -exec git --git-dir={}/.git --work-tree=$PWD/{} pull origin master \; } >> $LOG
# catcher Git-remote
# line
# Node update commands.
{ echo "Node"; echo ""; npm install npm@latest -g; npm update; npm prune; } >> $LOG

View file

@ -1,20 +1,87 @@
# MacUpdater
![macupdater logo](https://gugulet.hu/site/wp-content/uploads/macupdater-logo-1200x600-1.png)
This script updates brew, brew cask apps, apm packages, ruby gems, rvm, npm packages and macOS (including system software) Apps.
[![License: MIT](https://img.shields.io/badge/License-MIT-red.svg)](https://opensource.org/licenses/MIT)
## Dependencies
Package managment on macOS is a challenge. This is my amateurish attempt to combine all my package updates into one app. This app updates brew, brew cask apps, apm packages, ruby gems, rvm, npm packages and macOS (including system software) Apps. Note: the app only runs in admin account as it needs admin privileges.
brew
*https://brew.sh/*
## Before you start
apm
*Atom package manager*
This app relies on [alerter](https://github.com/vjeantet/alerter) for its notifications, so install that before you get started.
npm
*brew install node*
## Editing the script
mas
*brew install mas*
Editing the script requires some scripting know how, but it is documented. Here's a quick guide on how to customise it for your needs.
## Notes
Editing the script requires some scripting know how, but it is well documented.
### Preamble
In the preamble we get sudo rights and ask for the password to ensure everything that follows runs smoothly.
```shell
# Ask for the password up-front
sudo -v
# Keep-alive: update existing sudo time stamp if set, otherwise do nothing.
while true; do sudo -n true; sleep 60; kill -0 "$$" || exit; done 2>/dev/null &
```
And then we start the script by prompting the user.
```shell
# Open an alert that requires the user the click RUN to start the process.
ANSWER=$(./alerter -message "Run an update?" -actions Run -title macupdater -timeout 10 -sound default)
# Check the response from the alert and close if it is anything but RUN.
if [ $ANSWER = "@TIMEOUT" ]; then
echo "NOTIFICATION: Update process exited."
exit
elif [ $ANSWER = "@CLOSED" ]; then
exit
else
echo "NOTIFICATION: Updater starting..." # Send a notification (with logo)
fi
```
### Set variables
We set the path for the log file, which documents errors and progress. The path makes the script work when we use Platypus to convert it into an app.
```shell
# Set the path to the log file
export LOG=~/Desktop/macupdater-log.txt
# Export paths for appification.
export PATH="/usr/local/bin:/usr/bin:/bin:/usr/sbin:/$"
```
### Functions
The app has three functions: one to check the last update commands for errors, one to create a horizontal line in the log file and the last to open the log file at the end if there has been an error. I won;t go itno the functions here. You can read their comments in the file.
### Update commands
Lastly we have the update modules themselves for each package manager. Below is the update command for Homebrew. First it clears the Brew cache, then updates the log file, then runs updates, then upgrades, then cleanup. All of this is logged to the file (>> \$LOG). Then we call the catcher function to see if there have been any errors. And finally add a line to the log to seperate this from the next update section. You can add your won package managers in this fashion or remove some of the ones I have.
```shell
# Brew update commands.
{ trash -rf $(brew --cache); echo "Brew"; echo ""; brew update; brew upgrade; brew cleanup; } >> $LOG
catcher Brew
line
```
### Creating the app
I use [Platypus][https://github.com/sveinbjornt/platypus] to convert the script into an application for macOS. You are welcome to run this purely as a shell script. This is very much a work in progress, so feel free to tinker.
### Problems
The biggest problem I have right now is that this app needs to be run as an admin user. I prefer to use a non-admin account day-to-day so I'm going to have to tackle the run as another user problem soon. Running as a non-admin causes the brew and brew-cask updates to fail.
## License
All the works are available under the MIT license.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.