# dotbot-ifplatform Conditional execution of dotbot directives based on the local platform. ## Prerequisites This plugin requires [`dotbot`](https://github.com/anishathalye/dotbot) to be installed. ## Installation 1. Run `git submodule add https://github.com/ssbanerje/dotbot-ifplatform.git` 2. Run `git submodule update --init --recursive` 3. Pass in the CLI argument `--plugin-dir dotbot-ifplatform` when executing the `dotbot` executable. ## Usage Add the `if` directive to the `dotbot` YAML file to conditionally execute the directives. For example: ```yaml - ifubuntu: - apt: - ranger - ifarch: - pacman: - ranger - ifmacos: - brew: - ranger ``` ### Details The plugin queries the local platform string using the `distro` plugin. Acceptable values of `` in the `if` directive is shown below: | `` | Description | |--------------|--------------------------------------------| | anylinux | Any Linux in table | | anybsd | Any BSD in table | | macos | MacOS | | ubuntu | Ubuntu | | debian | Debian | | rhel | RedHat Enterprise Linux | | centos | CentOS | | fedora | Fedora | | sles | SUSE Linux Enterprise Server | | opensuse | openSUSE | | amazon | Amazon Linux | | arch | Arch Linux | | cloudlinux | CloudLinux OS | | exherbo | Exherbo Linux | | gentoo | GenToo Linux | | ibm_powerkvm | IBM PowerKVM | | kvmibm | KVM for IBM z Systems | | linuxmint | Linux Mint | | mageia | Mageia | | mandriva | Mandriva Linux | | parallels | Parallels | | pidora | Pidora | | raspbian | Raspbian | | oracle | Oracle Linux (and Oracle Enterprise Linux) | | scientific | Scientific Linux | | slackware | Slackware | | xenserver | XenServer | | openbsd | OpenBSD | | netbsd | NetBSD | | freebsd | FreeBSD | | midnightbsd | MidnightBSD | This list was generated using `distro` v1.6.0. There might be some differences based on the version of `distro` installed locally.