File tree Expand file tree Collapse file tree 4 files changed +20
-5
lines changed Expand file tree Collapse file tree 4 files changed +20
-5
lines changed Original file line number Diff line number Diff line change 1+ [submodule "lib/distro "]
2+ path = lib/distro
3+ url = [email protected] :python-distro/distro.git
Original file line number Diff line number Diff line change @@ -6,12 +6,10 @@ Conditional execution of dotbot directives based on the local platform.
66## Prerequisites
77This plugin requires [ ` dotbot ` ] ( https://github.com/anishathalye/dotbot ) to be installed.
88
9- Also, at runtime this plugin requires the ` distro ` package to be installed. To install distro run:
10- ` pip install -U distro `
11-
129## Installation
13101 . Run ` git submodule add https://github.com/ssbanerje/dotbot-ifplatform.git `
14- 2 . Pass in the CLI argument ` --plugin-dir dotbot-ifplatform ` when executing the ` dotbot ` executable.
11+ 2 . Run ` git submodule update --init --recursive `
12+ 3 . Pass in the CLI argument ` --plugin-dir dotbot-ifplatform ` when executing the ` dotbot ` executable.
1513
1614
1715## Usage
Original file line number Diff line number Diff line change 11#!/usr/bin/env python
22# -*- coding: utf-8 -*-
33
4- import distro
4+ import os
5+ import sys
56import dotbot
67from dotbot .dispatcher import Dispatcher
78
89
10+ def _inject_distro ():
11+ # Find distro in submodule
12+ root_dir = os .path .dirname (os .path .realpath (__file__ ))
13+ path = os .path .join (root_dir , 'lib/distro' )
14+ # Update path
15+ sys .path .insert (0 , path )
16+
17+
18+ _inject_distro ()
19+ import distro
20+
21+
922class IfPlatform (dotbot .Plugin ):
1023 _distros = [
1124 'anylinux' , # All linux
You can’t perform that action at this time.
0 commit comments