A simple script that checks for Notion updates based on the current version stored in a text file. If a new version is available, it prompts the user to package the new version. This is a workaround for deploying software more easily with an MDM.
Note: This has not been tested on Windows.
- Reads the current version of Notion from a
version.txt
file. - Checks for the latest version of Notion by incrementing the current version number.
- Notifies the user if a new version is available.
- Prompts the user to package the new version using
autopkg
.
autopkg
installed for packaging the new version of Notion.- An
autopkg
recipe for packaging Notion. (Recommended recipe repo is https://github.com/autopkg/swy-recipes)
-
Clone the repository:
git clone https://github.com/codyafingerson/notion-update-checker cd notion-update-checker
-
Ensure you give the bash script permission to execute by running
chmod +x ./check-notion.sh
-
Update the
ProgramArguments
key in the plist file to point to the correct location where you have cloned this repository. -
Move the plist file to the appropriate directory: The plist file should be placed in the
~/Library/LaunchAgents
directory for per-user agents.- You can execute
mv com.codyfingerson.notionupdates.plist ~/Library/LaunchAgents/
while in the directory where you cloned this repository.
- You can execute
-
Load the plist file into
launchd
using thelaunchctl
command:launchctl load ~/Library/LaunchAgents/com.codyfingerson.notionupdates.plist
-
The task should now be scheduled to run at the interval you specified. You can verify that everything worked by running:
launchctl list | grep com.codyfingerson.notionupdates
, and if successful, you should see something like- 78 com.codyfingerson.notionupdates
, where 78 is the process id, and most likely will be different from machine to machine.
PLIST Quick Tips
-
You can change the time and date that the script executes by modifying the
StartCalendarInterval
key. The hour is first, followed by the minute, and then the day of the week. The default is set to run at 9 AM, Monday through Friday.- 0 and 7 represent Sunday
- 1 represents Monday
- 2 represents Tuesday
- and so on...
-
If you would like to change the default location for error logs, you can change the
StandardOutPath
key to your desired location.
- The script reads the current version from
version.txt
. - It checks for the latest version of Notion by incrementing the patch, minor, and major versions sequentially.
- If a new version is found, it prompts the user to package the new version using
autopkg
. - If the user agrees, it writes the new version to
version.txt
and starts the packaging process.
This project is licensed under the MIT License - see the LICENSE file for details.
Cody Fingerson