Skip to content

Commit 063b0f9

Browse files
committed
Support ubuntu/arch linux
1 parent e2f082a commit 063b0f9

File tree

3 files changed

+30
-10
lines changed

3 files changed

+30
-10
lines changed

Makefile

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
DOTFILES_DIR := $(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
2-
OS := $(shell bin/is-supported bin/is-macos macos linux)
3-
HOMEBREW_PREFIX := $(shell bin/is-supported bin/is-macos $(shell bin/is-supported bin/is-arm64 /opt/homebrew /usr/local) /home/linuxbrew/.linuxbrew)
2+
OS := $(shell bin/is-supported bin/is-macos macos bin/is-ubuntu ubuntu bin/is-arch arch linux)
3+
HOMEBREW_PREFIX := $(shell bin/is-supported bin/is-arm64 /opt/homebrew /usr/local)
44
export N_PREFIX = $(HOME)/.n
55
PATH := $(HOMEBREW_PREFIX)/bin:$(DOTFILES_DIR)/bin:$(N_PREFIX)/bin:$(PATH)
66
SHELL := env PATH=$(PATH) /bin/bash
@@ -16,21 +16,32 @@ all: $(OS)
1616

1717
macos: sudo core-macos packages link duti bun
1818

19-
linux: core-linux link bun
19+
linux: ubuntu
20+
21+
ubuntu: core-ubuntu link bun
22+
23+
arch: core-arch link bun
2024

2125
core-macos: brew bash git npm
2226

23-
core-linux:
24-
apt-get update
25-
apt-get upgrade -y
26-
apt-get dist-upgrade -f
27+
core-ubuntu:
28+
sudo apt-get update
29+
sudo apt-get upgrade -y
30+
sudo apt-get dist-upgrade -f
31+
32+
stow-ubuntu: core-ubuntu
33+
is-executable stow || sudo apt-get -y install stow
34+
35+
core-arch:
36+
sudo pacman -Syu --noconfirm
37+
sudo pacman -S --noconfirm git base-devel
38+
39+
stow-arch: core-arch
40+
is-executable stow || pacman -S --noconfirm stow
2741

2842
stow-macos: brew
2943
is-executable stow || brew install stow
3044

31-
stow-linux: core-linux
32-
is-executable stow || apt-get -y install stow
33-
3445
sudo:
3546
ifndef GITHUB_ACTION
3647
sudo -v

bin/is-arch

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/bin/bash
2+
[ -f /etc/arch-release ]

bin/is-ubuntu

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/bash
2+
if [ -f /etc/os-release ]; then
3+
. /etc/os-release
4+
[ "$ID" = "ubuntu" ]
5+
else
6+
exit 1
7+
fi

0 commit comments

Comments
 (0)