diff --git a/src/commands/install/config/apps-groups/apps.ts b/src/commands/install/config/apps-groups/apps.ts index 7bf7515..61405ea 100755 --- a/src/commands/install/config/apps-groups/apps.ts +++ b/src/commands/install/config/apps-groups/apps.ts @@ -1,5 +1,12 @@ import type { IAppSetup } from '@models/app-setup.model' -import { BREW_CASK, BREW_INSTALL, BROW_CASK, OPEN_APP_STORE_APP_LINK, OPEN_BROWSER_LINK } from '../common-commands' +import { + BREW_CASK, + BREW_HOME, + BREW_INSTALL, + BROW_CASK, + OPEN_APP_STORE_APP_LINK, + OPEN_BROWSER_LINK, +} from '../common-commands' export const APPS: Readonly = [ { @@ -8,6 +15,7 @@ export const APPS: Readonly = [ description: 'Productivity app, create custom shortcuts and workflows (paid)', tags: ['productivity'], paid: true, + openUrl: () => BREW_HOME('alfred', true), commands: () => [BREW_CASK('alfred')], }, { @@ -16,6 +24,7 @@ export const APPS: Readonly = [ description: 'Hide menu bar icons and manage them (paid)', tags: ['productivity'], paid: true, + openUrl: () => BREW_HOME('bartender', true), commands: () => [BREW_CASK('bartender')], }, { @@ -23,6 +32,7 @@ export const APPS: Readonly = [ description: 'Cloud storage service by Google (password needed)', group: 'apps', default: true, + openUrl: () => BREW_HOME('google-drive', true), commands: () => [BREW_CASK('google-drive')], }, { @@ -30,36 +40,43 @@ export const APPS: Readonly = [ group: 'apps', description: 'Move and resize windows in macOS using keyboard shortcuts', tags: ['productivity'], + openUrl: () => BREW_HOME('rectangle', true), commands: () => [BREW_CASK('rectangle')], }, { name: 'MonitorControl', group: 'apps', description: 'Tool to control external monitor brightness and volume', + openUrl: () => BREW_HOME('monitorcontrol', true), commands: () => [BREW_CASK('monitorcontrol')], }, { name: 'Slack', group: 'apps', tags: ['work'], + openUrl: () => BREW_HOME('slack', true), commands: () => [BREW_CASK('slack')], }, { name: 'UTM', group: 'apps', description: 'Virtual machine MacOS', + openUrl: () => BREW_HOME('utm', true), commands: () => [BREW_CASK('utm')], }, { name: '1Password', group: 'apps', tags: ['personal', 'work'], + paid: true, + openUrl: () => BREW_HOME('1password', true), commands: () => [BREW_CASK('1password')], }, { name: 'Grammarly', group: 'apps', default: true, + openUrl: () => BREW_HOME('grammarly-desktop', true), commands: () => [BREW_CASK('grammarly-desktop')], }, { @@ -68,6 +85,7 @@ export const APPS: Readonly = [ group: 'apps', tags: ['productivity'], paid: true, + openUrl: () => BREW_HOME('cleanshot', true), commands: () => [BREW_CASK('cleanshot')], }, { @@ -76,6 +94,7 @@ export const APPS: Readonly = [ group: 'apps', tags: ['super-user'], paid: true, + openUrl: () => `open https://pasteapp.io/`, commands: () => [OPEN_APP_STORE_APP_LINK('paste-endless-clipboard/id967805235')], }, { @@ -84,6 +103,7 @@ export const APPS: Readonly = [ group: 'apps', tags: ['super-user'], paid: true, + openUrl: () => `open https://lowtechguys.com/rcmd/`, commands: () => [OPEN_APP_STORE_APP_LINK('rcmd-app-switcher/id1596283165')], }, { @@ -98,6 +118,7 @@ export const APPS: Readonly = [ description: 'Easy window resize & organize', group: 'apps', tags: ['super-user'], + openUrl: () => `open https://folivora.ai/bettersnaptool`, commands: () => [OPEN_APP_STORE_APP_LINK('bettersnaptool/id417375580')], }, { @@ -106,6 +127,7 @@ export const APPS: Readonly = [ group: 'apps', tags: ['productivity'], paid: true, + openUrl: () => BREW_HOME('textsniper', true), commands: () => [BREW_CASK('textsniper')], }, { @@ -113,6 +135,7 @@ export const APPS: Readonly = [ description: 'Emoji shortcuts for faster typing', group: 'apps', tags: ['productivity'], + openUrl: () => BREW_HOME('rocket', true), commands: () => [BREW_CASK('rocket')], }, { @@ -120,6 +143,7 @@ export const APPS: Readonly = [ description: 'Access hidden system settings on macOS', group: 'apps', tags: ['super-user'], + openUrl: () => `open https://www.bresink.com/osx/TinkerTool.html`, commands: () => [OPEN_BROWSER_LINK('https://www.bresink.com/osx/0TinkerTool/download.php')], }, { @@ -128,24 +152,28 @@ export const APPS: Readonly = [ group: 'apps', tags: ['super-user'], paid: true, + openUrl: () => `open https://dropoverapp.com/`, commands: () => [OPEN_APP_STORE_APP_LINK('dropover-easier-drag-drop/id1355679052')], }, { name: 'Hovrly', description: 'Easily see time zones in your menu bar', group: 'apps', + openUrl: () => BREW_HOME('hovrly'), commands: () => [BREW_INSTALL('hovrly')], }, { name: 'Notion', group: 'apps', tags: ['productivity'], + openUrl: () => BREW_HOME('notion', true), commands: () => [BREW_CASK('notion')], }, { name: 'WhatsApp', group: 'apps', tags: ['personal'], + openUrl: () => BREW_HOME('whatsapp', true), commands: () => [BREW_CASK('whatsapp')], fallbackCommands: () => [BROW_CASK('whatsapp')], }, @@ -153,6 +181,7 @@ export const APPS: Readonly = [ name: 'WhatsApp (legacy)', description: 'WhatsApp legacy version', group: 'apps', + openUrl: () => BREW_HOME('whatsapp', true), commands: () => [ BREW_CASK( 'https://raw.githubusercontent.com/Homebrew/homebrew-cask/2f428f0d63c346637aafd8a8b2f474670c2e42f1/Casks/w/whatsapp.rb', @@ -168,6 +197,7 @@ export const APPS: Readonly = [ name: 'Telegram', group: 'apps', tags: ['personal'], + openUrl: () => BREW_HOME('telegram', true), commands: () => [BREW_CASK('telegram')], fallbackCommands: () => [BROW_CASK('telegram')], }, @@ -175,6 +205,7 @@ export const APPS: Readonly = [ name: 'Dash', group: 'apps', description: 'Documentation browser', + openUrl: () => BREW_HOME('dash', true), commands: () => [BREW_CASK('dash')], }, { @@ -182,6 +213,7 @@ export const APPS: Readonly = [ group: 'apps', description: 'Unlocks the full brightness of your MacBook Pro (paid)', paid: true, + openUrl: () => BREW_HOME('vivid', true), commands: () => [BREW_CASK('vivid')], }, ] as const diff --git a/src/commands/install/config/apps-groups/cli-apps.ts b/src/commands/install/config/apps-groups/cli-apps.ts index 4619117..946b620 100755 --- a/src/commands/install/config/apps-groups/cli-apps.ts +++ b/src/commands/install/config/apps-groups/cli-apps.ts @@ -1,6 +1,7 @@ import type { IAppSetup } from '@models/app-setup.model' import { BREW_CASK, + BREW_HOME, BREW_INSTALL, BREW_TAP, BROW_ALIAS, @@ -18,6 +19,7 @@ export const CLI_APPS: Readonly = [ description: 'Node Version Manager (password needed)', group: 'cli-apps', tags: ['node-engineering', 'web-engineering', 'devops'], + openUrl: () => BREW_HOME('nvm'), commands: () => [ BREW_INSTALL('nvm'), '\\. "$(brew --prefix)/opt/nvm/nvm.sh"', @@ -38,6 +40,7 @@ export const CLI_APPS: Readonly = [ group: 'cli-apps', description: 'GitHub in your terminal', tags: ['engineering'], + openUrl: () => BREW_HOME('gh'), commands: () => [BREW_INSTALL('gh')], fallbackCommands: () => [BROW_INSTALL('gh')], }, @@ -46,6 +49,7 @@ export const CLI_APPS: Readonly = [ group: 'cli-apps', description: 'Integrate with Google Cloud Platform services (Python required)', tags: ['engineering'], + openUrl: () => BREW_HOME('google-cloud-sdk'), commands: () => [BREW_CASK('google-cloud-sdk')], fallbackCommands: () => [BROW_CASK('google-cloud-sdk')], deps: ['Python'], @@ -55,6 +59,7 @@ export const CLI_APPS: Readonly = [ group: 'cli-apps', description: 'Official Amazon AWS command-line interface (Python required)', tags: ['devops'], + openUrl: () => BREW_HOME('awscli'), commands: () => [BREW_INSTALL('awscli')], deps: ['Python'], }, @@ -63,6 +68,7 @@ export const CLI_APPS: Readonly = [ group: 'cli-apps', description: 'Kubernetes CLI, Switch faster between Kubernetes contexts and namespaces', tags: ['devops'], + openUrl: () => BREW_HOME('kubectx'), commands: () => [BREW_INSTALL('kubectx')], }, { @@ -70,6 +76,7 @@ export const CLI_APPS: Readonly = [ group: 'cli-apps', description: 'MongoDB Community Edition server', tags: ['engineering'], + openUrl: () => BREW_HOME('mongodb-community@6.0'), commands: () => [BREW_TAP('mongodb/brew'), BREW_INSTALL('mongodb-community@6.0'), 'mkdir -p "$HOME/mongodb"'], fallbackCommands: () => [ BROW_TAP('mongodb/brew'), @@ -82,6 +89,7 @@ export const CLI_APPS: Readonly = [ description: 'Redis server', group: 'cli-apps', tags: ['engineering'], + openUrl: () => BREW_HOME('redis'), commands: () => [BREW_INSTALL('redis')], fallbackCommands: () => [BROW_INSTALL('redis')], }, @@ -90,6 +98,7 @@ export const CLI_APPS: Readonly = [ description: 'Docker CLI', group: 'cli-apps', tags: ['node-engineering', 'devops'], + openUrl: () => BREW_HOME('docker'), commands: () => [BREW_INSTALL('docker')], }, { @@ -97,6 +106,7 @@ export const CLI_APPS: Readonly = [ description: 'Terraform CLI', group: 'cli-apps', tags: ['devops'], + openUrl: () => BREW_HOME('terraform'), commands: () => [BREW_INSTALL('terraform')], }, { @@ -104,12 +114,14 @@ export const CLI_APPS: Readonly = [ description: 'Kubernetes package manager', group: 'cli-apps', tags: ['devops'], + openUrl: () => BREW_HOME('helm'), commands: () => [BREW_INSTALL('helm')], }, { name: 'Btop', description: 'Resource monitor over the terminal', group: 'cli-apps', + openUrl: () => BREW_HOME('btop'), commands: () => [BREW_INSTALL('btop')], }, ] as const diff --git a/src/commands/install/config/apps-groups/engineering-apps.ts b/src/commands/install/config/apps-groups/engineering-apps.ts index 759da56..601ae1a 100755 --- a/src/commands/install/config/apps-groups/engineering-apps.ts +++ b/src/commands/install/config/apps-groups/engineering-apps.ts @@ -1,5 +1,5 @@ import type { IAppSetup } from '@models/app-setup.model' -import { BREW_CASK } from '../common-commands' +import { BREW_CASK, BREW_HOME } from '../common-commands' export const ENGINEERING_APPS: Readonly = [ { @@ -7,6 +7,7 @@ export const ENGINEERING_APPS: Readonly = [ description: 'MongoDB GUI, MongoDB is required', group: 'engineering-apps', tags: ['engineering'], + openUrl: () => BREW_HOME('mongodb-compass', true), commands: () => [BREW_CASK('mongodb-compass')], }, { @@ -14,6 +15,7 @@ export const ENGINEERING_APPS: Readonly = [ description: 'Redis GUI, Redis is required (password needed)', group: 'engineering-apps', tags: ['engineering'], + openUrl: () => BREW_HOME('another-redis-desktop-manager', true), commands: () => [ BREW_CASK('another-redis-desktop-manager'), `sudo xattr -rd com.apple.quarantine "/Applications/Another Redis Desktop Manager.app"`, @@ -23,6 +25,7 @@ export const ENGINEERING_APPS: Readonly = [ name: 'Rancher', description: 'Kubernetes and Docker UI tool', group: 'engineering-apps', + openUrl: () => BREW_HOME('rancher', true), commands: () => [BREW_CASK('rancher')], }, { @@ -30,6 +33,7 @@ export const ENGINEERING_APPS: Readonly = [ description: 'API client', group: 'engineering-apps', tags: ['engineering'], + openUrl: () => BREW_HOME('postman', true), commands: () => [BREW_CASK('postman')], }, ] diff --git a/src/commands/install/config/apps-groups/git.ts b/src/commands/install/config/apps-groups/git.ts index 03fd6dd..86e8052 100755 --- a/src/commands/install/config/apps-groups/git.ts +++ b/src/commands/install/config/apps-groups/git.ts @@ -1,5 +1,5 @@ import type { IAppSetup } from '@models/app-setup.model' -import { BREW_INSTALL } from '../common-commands' +import { BREW_HOME, BREW_INSTALL } from '../common-commands' export const GIT_APPS: Readonly = [ { @@ -7,6 +7,7 @@ export const GIT_APPS: Readonly = [ description: 'Common Code Version Manager', group: 'git', tags: ['engineering'], + openUrl: () => BREW_HOME('git'), commands: () => [BREW_INSTALL('git')], }, { @@ -14,6 +15,8 @@ export const GIT_APPS: Readonly = [ description: 'Apply rebase with VSCode UI editor (Git required)', group: 'git', tags: ['super-user'], + openUrl: () => + `open https://git-scm.com/book/en/v2/Customizing-Git-Git-Configuration#:~:text=documentation%20mentioned%20above.-,core.editor,-By%20default%2C%20Git`, commands: () => [ `git config --global core.editor "/Applications/Visual\\ Studio\\ Code.app/Contents/Resources/app/bin/code --wait"`, ], @@ -24,6 +27,7 @@ export const GIT_APPS: Readonly = [ description: 'Enable reuse recorded resolution for merge conflicts (Git required)', group: 'git', tags: ['super-user'], + openUrl: () => `open https://git-scm.com/book/en/v2/Git-Tools-Rerere`, commands: () => [ // avoid lock for other `git config` options 'sleep 1', @@ -35,6 +39,7 @@ export const GIT_APPS: Readonly = [ name: 'Increase credential cache timeout', description: 'Increase the cache time for using your credentials from Keychain - 1 month (Git required)', group: 'git', + openUrl: () => `open https://git-scm.com/docs/git-credential-cache`, commands: () => [ // avoid lock for other `git config` options 'sleep 2', @@ -47,6 +52,7 @@ export const GIT_APPS: Readonly = [ description: 'Automatically setup remote tracking branches on git push (Git required)', group: 'git', tags: ['productivity'], + openUrl: () => `open https://git-scm.com/docs/git-push#Documentation/git-push.txt-pushautoSetupRemote`, commands: () => [ // avoid lock for other `git config` options 'sleep 3', diff --git a/src/commands/install/config/apps-groups/ides.ts b/src/commands/install/config/apps-groups/ides.ts index 2fcad25..af37ced 100755 --- a/src/commands/install/config/apps-groups/ides.ts +++ b/src/commands/install/config/apps-groups/ides.ts @@ -1,11 +1,12 @@ import type { IAppSetup } from '@models/app-setup.model' -import { BREW_CASK, BROW_CASK } from '../common-commands' +import { BREW_CASK, BREW_HOME, BROW_CASK } from '../common-commands' export const IDES: Readonly = [ { name: 'Visual Studio Code', group: 'IDEs', tags: ['engineering'], + openUrl: () => BREW_HOME('visual-studio-code', true), commands: () => [BREW_CASK('visual-studio-code')], }, { @@ -13,6 +14,7 @@ export const IDES: Readonly = [ group: 'IDEs', tags: ['web-engineering', 'node-engineering'], paid: true, + openUrl: () => BREW_HOME('webstorm', true), commands: () => [BROW_CASK('webstorm')], fallbackCommands: () => [BREW_CASK('webstorm')], }, @@ -22,6 +24,7 @@ export const IDES: Readonly = [ tags: ['python-engineering'], description: 'Python IDE', paid: true, + openUrl: () => BREW_HOME('pycharm', true), commands: () => [BROW_CASK('pycharm')], fallbackCommands: () => [BREW_CASK('pycharm')], }, diff --git a/src/commands/install/config/apps-groups/mac.ts b/src/commands/install/config/apps-groups/mac.ts index d31d193..30fd068 100755 --- a/src/commands/install/config/apps-groups/mac.ts +++ b/src/commands/install/config/apps-groups/mac.ts @@ -1,5 +1,5 @@ import type { IAppSetup } from '@models/app-setup.model' -import { BREW_INSTALL } from '../common-commands' +import { BREW_HOME, BREW_INSTALL } from '../common-commands' export const MACOS: Readonly = [ { @@ -8,6 +8,7 @@ export const MACOS: Readonly = [ group: 'MacOS', default: true, first: true, + openUrl: () => `open https://gist.github.com/windyinsc/26aaa8783c7734529998062a11d80b96`, commands: () => [ 'sudo -v', 'sudo cp -f /etc/pam.d/sudo_local.template /etc/pam.d/sudo_local', @@ -18,6 +19,7 @@ export const MACOS: Readonly = [ name: 'smartmontools', description: 'Monitor your hard drive health', group: 'MacOS', + openUrl: () => BREW_HOME('smartmontools'), commands: () => [BREW_INSTALL('smartmontools')], }, { diff --git a/src/commands/install/config/apps-groups/media.ts b/src/commands/install/config/apps-groups/media.ts index 100188c..553c6ae 100755 --- a/src/commands/install/config/apps-groups/media.ts +++ b/src/commands/install/config/apps-groups/media.ts @@ -1,5 +1,5 @@ import type { IAppSetup } from '@models/app-setup.model' -import { BREW_CASK } from '../common-commands' +import { BREW_CASK, BREW_HOME } from '../common-commands' export const MEDIA_APPS: Readonly = [ { @@ -7,17 +7,21 @@ export const MEDIA_APPS: Readonly = [ description: 'Video downloader for YouTube and other video sites (paid)', group: 'media', paid: true, + openUrl: () => BREW_HOME('downie', true), commands: () => [BREW_CASK('downie')], }, { name: 'VLC', group: 'media', + description: 'Open-source multimedia player', + openUrl: () => BREW_HOME('vlc', true), commands: () => [BREW_CASK('vlc')], }, { name: 'Subler', description: 'MP4 metadata editor, video converter, and muxer', group: 'media', + openUrl: () => BREW_HOME('subler', true), commands: () => [BREW_CASK('subler')], }, ] as const diff --git a/src/commands/install/config/apps-groups/node.ts b/src/commands/install/config/apps-groups/node.ts index aa3a3f9..3d79d8d 100755 --- a/src/commands/install/config/apps-groups/node.ts +++ b/src/commands/install/config/apps-groups/node.ts @@ -1,58 +1,67 @@ import type { IAppSetup } from '@models/app-setup.model' -import { NODE_GLOBAL } from '../common-commands' +import { NODE_GLOBAL, NPM_HOME } from '../common-commands' export const NODE_APPS: Readonly = [ { name: '@angular/cli', group: 'node', tags: ['web-engineering'], + openUrl: () => NPM_HOME('@angular/cli'), commands: () => [NODE_GLOBAL('@angular/cli')], }, { name: '@nestjs/cli', group: 'node', tags: ['node-engineering'], + openUrl: () => NPM_HOME('@nestjs/cli'), commands: () => [NODE_GLOBAL('@nestjs/cli')], }, { name: 'nx', group: 'node', tags: ['web-engineering', 'node-engineering'], + openUrl: () => NPM_HOME('nx'), commands: () => [NODE_GLOBAL('nx')], }, { name: 'jest', group: 'node', tags: ['web-engineering', 'node-engineering'], + openUrl: () => NPM_HOME('jest'), commands: () => [NODE_GLOBAL('jest')], }, { name: 'ts-jest', group: 'node', + openUrl: () => NPM_HOME('ts-jest'), commands: () => [NODE_GLOBAL('ts-jest')], }, { name: 'ts-node-dev', group: 'node', tags: ['node-engineering'], + openUrl: () => NPM_HOME('ts-node-dev'), commands: () => [NODE_GLOBAL('ts-node-dev')], }, { name: 'ts-node', group: 'node', tags: ['node-engineering'], + openUrl: () => NPM_HOME('ts-node'), commands: () => [NODE_GLOBAL('ts-node')], }, { name: 'typescript', group: 'node', tags: ['web-engineering', 'node-engineering'], + openUrl: () => NPM_HOME('typescript'), commands: () => [NODE_GLOBAL('typescript')], }, { name: 'nodemon', group: 'node', tags: ['node-engineering'], + openUrl: () => NPM_HOME('nodemon'), commands: () => [NODE_GLOBAL('nodemon')], }, { @@ -60,6 +69,7 @@ export const NODE_APPS: Readonly = [ description: 'Full report of all the modules in node_modules and their sizes', group: 'node', tags: ['web-engineering', 'node-engineering'], + openUrl: () => NPM_HOME('cost-of-modules'), commands: () => [NODE_GLOBAL('cost-of-modules')], }, { @@ -67,6 +77,7 @@ export const NODE_APPS: Readonly = [ description: 'Manage multiple .npmrc files effortlessly', group: 'node', tags: ['web-engineering', 'node-engineering', 'devops'], + openUrl: () => NPM_HOME('npmrc'), commands: () => [NODE_GLOBAL('npmrc')], }, { @@ -74,66 +85,62 @@ export const NODE_APPS: Readonly = [ description: 'A robust static dependency analyzer for your JavaScript and TypeScript projects', group: 'node', tags: ['web-engineering'], + openUrl: () => NPM_HOME('dpdm'), commands: () => [NODE_GLOBAL('dpdm')], }, { name: 'verdaccio', group: 'node', + openUrl: () => NPM_HOME('verdaccio'), commands: () => [NODE_GLOBAL('verdaccio')], }, { name: 'ttab', group: 'node', + openUrl: () => NPM_HOME('ttab'), commands: () => [NODE_GLOBAL('ttab')], }, { name: 'alfred-open-whatsapp', group: 'node', + openUrl: () => NPM_HOME('alfred-open-whatsapp'), commands: () => [NODE_GLOBAL('alfred-open-whatsapp')], }, { name: 'alfred-search-bookmark', group: 'node', + openUrl: () => NPM_HOME('alfred-search-bookmark'), commands: () => [NODE_GLOBAL('alfred-search-bookmark')], }, - { - name: 'corepack', - group: 'node', - commands: () => [NODE_GLOBAL('corepack')], - }, { name: 'gulp-cli', group: 'node', + openUrl: () => NPM_HOME('gulp-cli'), commands: () => [NODE_GLOBAL('gulp-cli')], }, { name: 'http-server', group: 'node', + openUrl: () => NPM_HOME('http-server'), commands: () => [NODE_GLOBAL('http-server')], }, - { - name: 'jest', - group: 'node', - commands: () => [NODE_GLOBAL('jest')], - }, { name: 'npkill', + description: 'List & clear any node_modules directories in your system', group: 'node', + openUrl: () => NPM_HOME('npkill'), commands: () => [NODE_GLOBAL('npkill')], }, { name: 'prettier', group: 'node', + openUrl: () => NPM_HOME('prettier'), commands: () => [NODE_GLOBAL('prettier')], }, - { - name: '@githubnext/github-copilot-cli', - group: 'node', - commands: () => [NODE_GLOBAL('@githubnext/github-copilot-cli')], - }, { name: 'vercel', group: 'node', + openUrl: () => NPM_HOME('vercel'), commands: () => [NODE_GLOBAL('vercel')], }, ] as const diff --git a/src/commands/install/config/apps-groups/python.ts b/src/commands/install/config/apps-groups/python.ts index 886ae17..7ce0a2c 100755 --- a/src/commands/install/config/apps-groups/python.ts +++ b/src/commands/install/config/apps-groups/python.ts @@ -15,6 +15,7 @@ export const PYTHON: Readonly = [ description: 'Python package manager (Python required)', group: 'python', default: true, + openUrl: () => `open https://pypi.org/project/pip/`, commands: () => [ `${CURL_COMMAND} https://bootstrap.pypa.io/get-pip.py -o /tmp/get-pip.py`, 'python3 /tmp/get-pip.py --break-system-packages', diff --git a/src/commands/install/config/apps-groups/security-privacy.ts b/src/commands/install/config/apps-groups/security-privacy.ts index d2bf290..62bf4ca 100755 --- a/src/commands/install/config/apps-groups/security-privacy.ts +++ b/src/commands/install/config/apps-groups/security-privacy.ts @@ -1,5 +1,5 @@ import type { IAppSetup } from '@models/app-setup.model' -import { BREW_CASK, OPEN_APP_STORE_APP_LINK } from '../common-commands' +import { BREW_CASK, BREW_HOME, OPEN_APP_STORE_APP_LINK } from '../common-commands' export const SECURITY_PRIVACY: Readonly = [ { @@ -7,6 +7,7 @@ export const SECURITY_PRIVACY: Readonly = [ description: 'Protect your device from theft (paid)', group: 'security-privacy', paid: true, + openUrl: () => `open https://unplugalarm.app/`, commands: () => [OPEN_APP_STORE_APP_LINK('unplug-alarm-anti-theft-app/id1489026302')], }, { @@ -14,6 +15,7 @@ export const SECURITY_PRIVACY: Readonly = [ description: 'Firewall to detect and block any application from accessing the internet (paid)', group: 'security-privacy', paid: true, + openUrl: () => BREW_HOME('radio-silence', true), commands: () => [BREW_CASK('radio-silence')], }, ] diff --git a/src/commands/install/config/apps-groups/terminal.ts b/src/commands/install/config/apps-groups/terminal.ts index 1973c7c..6ccdc7d 100755 --- a/src/commands/install/config/apps-groups/terminal.ts +++ b/src/commands/install/config/apps-groups/terminal.ts @@ -1,5 +1,5 @@ import type { IAppSetup } from '@models/app-setup.model' -import { BREW_CASK, BREW_INSTALL, BREW_TAP, BROW_ALIAS, BROW_INSTALL, BROW_TAP } from '../common-commands' +import { BREW_CASK, BREW_HOME, BREW_INSTALL, BREW_TAP, BROW_ALIAS, BROW_INSTALL, BROW_TAP } from '../common-commands' export const TERMINAL_APPS: Readonly = [ { @@ -7,18 +7,21 @@ export const TERMINAL_APPS: Readonly = [ description: 'Terminal with a power of code editor', group: 'terminal', tags: ['super-user'], + openUrl: () => BREW_HOME('warp', true), commands: () => [BREW_CASK('warp')], }, { name: 'iTerm2', description: 'Terminal replacement', group: 'terminal', + openUrl: () => BREW_HOME('iterm2', true), commands: () => [BREW_CASK('iterm2')], }, { name: 'Fig', group: 'terminal', tags: ['productivity'], + openUrl: () => BREW_HOME('fig', true), commands: () => [BREW_CASK('fig')], }, { @@ -26,6 +29,7 @@ export const TERMINAL_APPS: Readonly = [ description: 'Search & execute through your shell history, with context-aware suggestions and neural network.', group: 'terminal', tags: ['productivity'], + openUrl: () => BREW_HOME('cantino/mcfly/mcfly'), commands: () => [BREW_TAP('cantino/mcfly'), BREW_INSTALL('cantino/mcfly/mcfly')], fallbackCommands: () => [BROW_TAP('cantino/mcfly'), BROW_INSTALL('cantino/mcfly/mcfly')], }, @@ -34,6 +38,7 @@ export const TERMINAL_APPS: Readonly = [ description: 'Syntax highlighting for cat', group: 'terminal', tags: ['productivity'], + openUrl: () => BREW_HOME('bat'), commands: () => [BREW_INSTALL('bat')], }, { @@ -41,12 +46,14 @@ export const TERMINAL_APPS: Readonly = [ description: 'A faster way to navigate your filesystem - replace your native `cd` with memory-based autojump', group: 'terminal', tags: ['productivity'], + openUrl: () => BREW_HOME('zoxide'), commands: () => [BREW_INSTALL('zoxide')], }, { name: 'ZSH Terminal Syntax Highlighting', group: 'terminal', tags: ['engineering'], + openUrl: () => BREW_HOME('zsh-syntax-highlighting'), commands: () => [BREW_INSTALL('zsh-syntax-highlighting')], fallbackCommands: () => [BROW_INSTALL('zsh-syntax-highlighting')], }, @@ -54,6 +61,7 @@ export const TERMINAL_APPS: Readonly = [ name: 'ZSH Terminal Syntax Autosuggestions', group: 'terminal', tags: ['engineering'], + openUrl: () => BREW_HOME('zsh-autosuggestions'), commands: () => [BREW_INSTALL('zsh-autosuggestions')], fallbackCommands: () => [BROW_INSTALL('zsh-autosuggestions')], }, @@ -61,6 +69,7 @@ export const TERMINAL_APPS: Readonly = [ name: 'ZSH Terminal Syntax Completions', description: 'Completions for zsh (password needed)', group: 'terminal', + openUrl: () => BREW_HOME('zsh-completions'), commands: () => [ BREW_INSTALL('zsh-completions'), `chmod go-w "$(brew --prefix)/share"`, diff --git a/src/commands/install/config/common-commands.ts b/src/commands/install/config/common-commands.ts index 5b41427..9624a99 100755 --- a/src/commands/install/config/common-commands.ts +++ b/src/commands/install/config/common-commands.ts @@ -2,28 +2,41 @@ import type { Arch } from '@models/app-setup.model' const ARCH_FLAG = (arch?: Arch): '' | `arch -${Arch}` => (arch ? `arch -${arch}` : '') export const BROW_ALIAS = `arch --x86_64 /usr/local/Homebrew/bin/brew` +const BREW_NON_INTERACTIVE_FLAGS = `yes | HOMEBREW_NO_AUTO_UPDATE=1 NONINTERACTIVE=1` -// BREW -export const BREW_CASK = (app: string) => `yes | HOMEBREW_NO_AUTO_UPDATE=1 NONINTERACTIVE=1 brew install --cask ${app}` -export const BREW_INSTALL = (formula: string) => - `yes | HOMEBREW_NO_AUTO_UPDATE=1 NONINTERACTIVE=1 brew install ${formula}` -export const BREW_TAP = (tapTo: string) => `yes | HOMEBREW_NO_AUTO_UPDATE=1 NONINTERACTIVE=1 brew tap ${tapTo}` +/** + * General + */ +export const OPEN_BROWSER_LINK = (link: string) => `open ${link}` -// BROW -export const BROW_CASK = (app: string) => - `yes | HOMEBREW_NO_AUTO_UPDATE=1 NONINTERACTIVE=1 ${BROW_ALIAS} install --cask ${app}` -export const BROW_INSTALL = (formula: string) => - `yes | HOMEBREW_NO_AUTO_UPDATE=1 NONINTERACTIVE=1 ${BROW_ALIAS} install ${formula}` -export const BROW_TAP = (tapTo: string) => `yes | HOMEBREW_NO_AUTO_UPDATE=1 NONINTERACTIVE=1 ${BROW_ALIAS} tap ${tapTo}` +/** + * HomeBrew + */ +export const BREW_CASK = (app: string) => `${BREW_NON_INTERACTIVE_FLAGS} brew install --cask ${app}` +export const BREW_HOME = (app: string, cask: boolean = false) => + `${BREW_NON_INTERACTIVE_FLAGS} brew home ${cask ? '--cask' : ''} ${app}` +export const BREW_INSTALL = (formula: string) => `${BREW_NON_INTERACTIVE_FLAGS} brew install ${formula}` +export const BREW_TAP = (tapTo: string) => `${BREW_NON_INTERACTIVE_FLAGS} brew tap ${tapTo}` -// NODE -export const NODE_GLOBAL = (packageName: string) => - `source $HOME/.nvm/nvm.sh && npm install -g ${packageName} --registry=https://registry.npmjs.org/` - -export const NVM_COMMAND = (command: string) => `source $HOME/.nvm/nvm.sh && nvm ${command}` - -// App Store -export const OPEN_BROWSER_LINK = (link: string) => `open -a Safari ${link}` +/** + * HomeBrew - Rosetta + */ +export const BROW_CASK = (app: string) => `${BREW_NON_INTERACTIVE_FLAGS} ${BROW_ALIAS} install --cask ${app}` +export const BROW_INSTALL = (formula: string) => `${BREW_NON_INTERACTIVE_FLAGS} ${BROW_ALIAS} install ${formula}` +export const BROW_TAP = (tapTo: string) => `${BREW_NON_INTERACTIVE_FLAGS} ${BROW_ALIAS} tap ${tapTo}` +/** + * App Store + */ export const OPEN_APP_STORE_APP_LINK = (appPath: `${string}/id${number}`) => OPEN_BROWSER_LINK(`https://apps.apple.com/il/app/${appPath}`) + +/** + * NodeJS + */ +const LOAD_NVM = `source $HOME/.nvm/nvm.sh` +export const NODE_GLOBAL = (packageName: string) => + `${LOAD_NVM} && npm install -g ${packageName} --registry=https://registry.npmjs.org/` +export const NPM_HOME = (packageName: string) => OPEN_BROWSER_LINK(`https://www.npmjs.com/package/${packageName}`) + +export const NVM_COMMAND = (command: string) => `${LOAD_NVM} && nvm ${command}`