Latest
This commit is contained in:
parent
866884ef3e
commit
7bf6928568
4 changed files with 242 additions and 102 deletions
|
@ -1,15 +1,18 @@
|
||||||
https://github.com/harababurel/gcsf
|
https://github.com/harababurel/gcsf
|
||||||
|
[text](https://github.com/gitbito/CLI)
|
||||||
* Move age decryption higher
|
* Move age decryption higher
|
||||||
* Add ~/.local/share/sounds was symlink to {{ .host.home }}/.local/share/betelgeuse/share/sounds
|
* Add ~/.local/share/sounds was symlink to {{ .host.home }}/.local/share/betelgeuse/share/sounds
|
||||||
xattr -d com.apple.quarantine rclone
|
xattr -d com.apple.quarantine rclone
|
||||||
Create issue about setting up completions - https://github.com/rsteube/lazycomplete
|
Create issue about setting up completions - https://github.com/rsteube/lazycomplete
|
||||||
pw="$(osascript -e 'Tell application "System Events" to display dialog "Password:" default answer "" with hidden answer' -e 'text returned of result' 2>/dev/null)" && echo "$pw"
|
pw="$(osascript -e 'Tell application "System Events" to display dialog "Password:" default answer "" with hidden answer' -e 'text returned of result' 2>/dev/null)" && echo "$pw"
|
||||||
https://github.com/Shougo/ddc.vim
|
https://github.com/Shougo/ddc.vim
|
||||||
|
[text](https://instill.tech/chill/models)
|
||||||
https://github.com/harababurel/gcsf
|
https://github.com/harababurel/gcsf
|
||||||
https://github.com/awslabs/mountpoint-s3 / https://github.com/s3fs-fuse/s3fs-fuse
|
https://github.com/awslabs/mountpoint-s3 / https://github.com/s3fs-fuse/s3fs-fuse
|
||||||
https://github.com/superfly/litefs
|
https://github.com/superfly/litefs
|
||||||
https://github.com/Qihoo360/QConf
|
https://github.com/Qihoo360/QConf
|
||||||
https://github.com/ossec/ossec-hids
|
https://github.com/ossec/ossec-hids
|
||||||
|
[text](https://github.com/invoke-ai/InvokeAI)
|
||||||
https://github.com/search?q=system&type=repositories&s=stars&o=desc&p=59
|
https://github.com/search?q=system&type=repositories&s=stars&o=desc&p=59
|
||||||
- https://github.com/nats-io/nats-server
|
- https://github.com/nats-io/nats-server
|
||||||
- [Title](https://github.com/albfan/miraclecast)
|
- [Title](https://github.com/albfan/miraclecast)
|
||||||
|
|
|
@ -167,6 +167,12 @@ removeLinuxShortcuts:
|
||||||
- scvim.desktop
|
- scvim.desktop
|
||||||
theme: Betelgeuse
|
theme: Betelgeuse
|
||||||
softwareGroups:
|
softwareGroups:
|
||||||
|
AI: &AI
|
||||||
|
- aider
|
||||||
|
- ai-shell
|
||||||
|
- aifiles
|
||||||
|
- talksheet
|
||||||
|
- tgpt
|
||||||
AI-Desktop: &AI-Desktop
|
AI-Desktop: &AI-Desktop
|
||||||
- chatgpt-nofwl
|
- chatgpt-nofwl
|
||||||
- chatgpt-menubar
|
- chatgpt-menubar
|
||||||
|
@ -347,6 +353,7 @@ softwareGroups:
|
||||||
- zenity
|
- zenity
|
||||||
CLI-Extras: &CLI-Extras
|
CLI-Extras: &CLI-Extras
|
||||||
- ack
|
- ack
|
||||||
|
- airdrop-cli
|
||||||
- axel
|
- axel
|
||||||
- bin
|
- bin
|
||||||
- bitly
|
- bitly
|
||||||
|
@ -1355,6 +1362,7 @@ softwareGroups:
|
||||||
- warp
|
- warp
|
||||||
_Full: &_Full
|
_Full: &_Full
|
||||||
- *_Standard
|
- *_Standard
|
||||||
|
- *AI
|
||||||
- *Android
|
- *Android
|
||||||
- *Ansible
|
- *Ansible
|
||||||
- *Backup
|
- *Backup
|
||||||
|
|
|
@ -6,13 +6,29 @@ import osInfo from 'linux-os-info'
|
||||||
let installOrder, osArch, osId, osType, pkgs, sysType
|
let installOrder, osArch, osId, osType, pkgs, sysType
|
||||||
const cacheDir = os.homedir() + '/.cache/installx'
|
const cacheDir = os.homedir() + '/.cache/installx'
|
||||||
|
|
||||||
|
function log(message) {
|
||||||
|
console.log(`${chalk.cyanBright('instx->')} ${message}`)
|
||||||
|
}
|
||||||
|
|
||||||
async function getOsInfo() {
|
async function getOsInfo() {
|
||||||
return osInfo({ mode: 'sync' })
|
return osInfo({ mode: 'sync' })
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function execPromise(command) {
|
||||||
|
return new Promise(function (resolve, reject) {
|
||||||
|
require('child_process').exec(command, (error, stdout, stderr) => {
|
||||||
|
if (error) {
|
||||||
|
reject(error)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
resolve(stdout.trim())
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
async function runSilentCommand(command) {
|
async function runSilentCommand(command) {
|
||||||
require('child_process').execSync(`${command}`, { stdio: 'inherit', shell: true })
|
require('child_process').execSync(`${command}`, { stdio: 'inherit', shell: true })
|
||||||
}
|
}
|
||||||
|
|
||||||
async function runScript(key, script) {
|
async function runScript(key, script) {
|
||||||
fs.writeFileSync(`${cacheDir}/${key}`, script)
|
fs.writeFileSync(`${cacheDir}/${key}`, script)
|
||||||
|
@ -112,16 +128,55 @@ function expandDeps(keys) {
|
||||||
return [...keys]
|
return [...keys]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async function createCaskLinks() {
|
||||||
|
const caskApps = pkgMap(pkgs)
|
||||||
|
.filter(x => {
|
||||||
|
// Filter out macOS apps that already have a _app installed
|
||||||
|
if (x.installType === 'cask' || (osId === 'darwin' && x._app)) {
|
||||||
|
const appField = getPkgData('_app', x, x.installType)
|
||||||
|
const binField = getPkgData('_bin', x, x.installType)
|
||||||
|
const sysDir = fs.existsSync(`/Applications/${x[appField]}`)
|
||||||
|
const homeDir = fs.existsSync(`${os.homedir()}/Applications/${x[appField]}`)
|
||||||
|
const binFile = fs.existsSync(`${os.homedir()}/.local/bin/cask/${x[binField]}`)
|
||||||
|
return (sysDir || homeDir) && !binFile
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
})
|
||||||
|
caskApps.length && await $`mkdir -p "$HOME/.local/bin/cask"`
|
||||||
|
for (const app of caskApps) {
|
||||||
|
const appField = getPkgData('_app', app, app.installType)
|
||||||
|
const binField = getPkgData('_bin', app, app.installType)
|
||||||
|
if (fs.existsSync(`${os.homedir()}/Applications/${x[appField]}`)) {
|
||||||
|
fs.writeFileSync(`${os.homedir()}/.local/bin/cask/${x[binField]}`, `open "$HOME/Applications/${x[appField]}" $*`)
|
||||||
|
} else if (fs.existsSync(`/Applications/${x[appField]}`)) {
|
||||||
|
fs.writeFileSync(`${os.homedir()}/.local/bin/cask/${x[binField]}`, `open "/Applications/${x[appField]}" $*`)
|
||||||
|
} else {
|
||||||
|
log(`Unable to create bin link to ${x[appField]}`)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
caskApps.length && log(`Finished creating Homebrew cask links in ~/.local/bin/cask`)
|
||||||
|
}
|
||||||
|
|
||||||
async function bundleInstall(brews, casks) {
|
async function bundleInstall(brews, casks) {
|
||||||
const lines = []
|
try {
|
||||||
for (const cask of casks) {
|
const lines = []
|
||||||
lines.push(`cask "${cask.cask}"`)
|
log(`Adding following casks to Brewfile for installation: ${casks.join(' ')}`)
|
||||||
|
for (const cask of casks) {
|
||||||
|
lines.push(`cask "${cask}"`)
|
||||||
|
}
|
||||||
|
log(`Adding following brews to Brewfile for installation: ${casks.join(' ')}`)
|
||||||
|
for (const brew of brews) {
|
||||||
|
lines.push(`brew "${brew}"`)
|
||||||
|
}
|
||||||
|
log(`Creating Brewfile to install from`)
|
||||||
|
fs.writeFileSync('Brewfile', lines.join('\n'))
|
||||||
|
log(`Installing packages via brew bundle`)
|
||||||
|
await $`brew bundle --file Brewfile`
|
||||||
|
log(`Finished installing via Brewfile`)
|
||||||
|
await createCaskLinks()
|
||||||
|
} catch (e) {
|
||||||
|
log(`Error occurred while installing via Brewfile`)
|
||||||
}
|
}
|
||||||
for (const brew of brews) {
|
|
||||||
lines.push(`brew "${brew.brew}"`)
|
|
||||||
}
|
|
||||||
fs.writeFileSync('Brewfile', lines.join('\n'))
|
|
||||||
await $`brew bundle --file Brewfile`
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async function forEachSeries(iterable) {
|
async function forEachSeries(iterable) {
|
||||||
|
@ -133,17 +188,21 @@ async function forEachSeries(iterable) {
|
||||||
async function installPackages(pkgInstructions) {
|
async function installPackages(pkgInstructions) {
|
||||||
const combined = {}
|
const combined = {}
|
||||||
const promises = []
|
const promises = []
|
||||||
|
log(`Populating install order lists`)
|
||||||
for (const option of installOrder[sysType]) {
|
for (const option of installOrder[sysType]) {
|
||||||
|
console.log(installOrder[sysType])
|
||||||
const instructions = pkgInstructions.filter(x => x.installType === option)
|
const instructions = pkgInstructions.filter(x => x.installType === option)
|
||||||
if (instructions.length) {
|
if (instructions.length) {
|
||||||
combined[option] = instructions
|
combined[option] = instructions
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
log(`Running Homebrew installation via Brewfile`)
|
||||||
if ((combined.brew && combined.brew.length) || (combined.cask && combined.cask.length)) {
|
if ((combined.brew && combined.brew.length) || (combined.cask && combined.cask.length)) {
|
||||||
promises.push(bundleInstall(combined.brew ? combined.brew : [], combined.cask ? combined.cask : []))
|
promises.push(bundleInstall(combined.brew ? combined.brew.flatMap(x => x.installList.flatMap(i => i)) : [], combined.cask ? combined.cask.flatMap(x => x.installList.flatMap(i => i)) : []))
|
||||||
}
|
}
|
||||||
for (const key of Object.keys(combined)) {
|
for (const key of Object.keys(combined)) {
|
||||||
switch(key) {
|
log(`Install orders for ${key}: ${combined[key].flatMap(i => i.installList).join(' ')}`)
|
||||||
|
switch (key) {
|
||||||
case 'ansible':
|
case 'ansible':
|
||||||
promises.push(forEachSeries(combined[key].flatMap(x => x.installList.flatMap(i => $`${key} 127.0.0.1 -v${process.env.DEBUG && 'vv'} -e '{ ansible_connection: "local", ansible_become_user: "root", ansible_user: "${process.env.USER}", ansible_family: "${osId.charAt(0).toUpperCase() + osId.slice(1)}", install_homebrew: False }' -m include_role -a name=${i}`))))
|
promises.push(forEachSeries(combined[key].flatMap(x => x.installList.flatMap(i => $`${key} 127.0.0.1 -v${process.env.DEBUG && 'vv'} -e '{ ansible_connection: "local", ansible_become_user: "root", ansible_user: "${process.env.USER}", ansible_family: "${osId.charAt(0).toUpperCase() + osId.slice(1)}", install_homebrew: False }' -m include_role -a name=${i}`))))
|
||||||
case 'apk':
|
case 'apk':
|
||||||
|
@ -172,67 +231,69 @@ async function installPackages(pkgInstructions) {
|
||||||
case 'scoop': // Maybe needs forEachSeries
|
case 'scoop': // Maybe needs forEachSeries
|
||||||
case 'winget': // Maybe needs forEachSeries
|
case 'winget': // Maybe needs forEachSeries
|
||||||
promises.push(...combined[key].flatMap(x => x.installList.flatMap(i => $`${key} install ${i}`)))
|
promises.push(...combined[key].flatMap(x => x.installList.flatMap(i => $`${key} install ${i}`)))
|
||||||
break;
|
break
|
||||||
case 'binary':
|
case 'binary':
|
||||||
// TODO
|
// TODO
|
||||||
promises.push(...combined[key].flatMap(x => x.installList.flatMap(i => $`TMP="$(mktemp)" && curl -sSL ${i} > "$TMP" && sudo mv "$TMP" /usr/local/src/${x._bin} && chmod +x /usr/local/src/${x._bin}`)))
|
promises.push(...combined[key].flatMap(x => x.installList.flatMap(i => $`TMP="$(mktemp)" && curl -sSL ${i} > "$TMP" && sudo mv "$TMP" /usr/local/src/${x._bin} && chmod +x /usr/local/src/${x._bin}`)))
|
||||||
case 'brew':
|
case 'brew':
|
||||||
case 'cask': // Handled above
|
case 'cask': // Handled above
|
||||||
break;
|
break
|
||||||
case 'choco':
|
case 'choco':
|
||||||
promises.push($`${key} install -y ${combined[key].flatMap(x => x.installList).split(' ')}`)
|
promises.push($`${key} install -y ${combined[key].flatMap(x => x.installList).join(' ')}`)
|
||||||
case 'dnf':
|
case 'dnf':
|
||||||
case 'yum':
|
case 'yum':
|
||||||
case 'zypper':
|
case 'zypper':
|
||||||
promises.push($`sudo ${key} install -y ${combined[key].flatMap(x => x.installList).split(' ')}`)
|
promises.push($`sudo ${key} install -y ${combined[key].flatMap(x => x.installList).join(' ')}`)
|
||||||
break;
|
break
|
||||||
case 'emerge':
|
case 'emerge':
|
||||||
case 'pkg_add':
|
case 'pkg_add':
|
||||||
promises.push($`sudo ${key} ${combined[key].flatMap(x => x.installList).split(' ')}`)
|
promises.push($`sudo ${key} ${combined[key].flatMap(x => x.installList).join(' ')}`)
|
||||||
break;
|
break
|
||||||
case 'eopkg':
|
case 'eopkg':
|
||||||
case 'pkg-freebsd':
|
case 'pkg-freebsd':
|
||||||
case 'pkg-termux':
|
case 'pkg-termux':
|
||||||
case 'pkgin':
|
case 'pkgin':
|
||||||
case 'port':
|
case 'port':
|
||||||
case 'snap': // TODO - snap testing.. combine with snap-classic and add appropriate logic
|
case 'snap': // TODO - snap testing.. combine with snap-classic and add appropriate logic
|
||||||
promises.push($`sudo ${key === 'pkg-freebsd' || key === 'pkg-termux' ? 'pkg' : key} install ${combined[key].flatMap(x => x.installList).split(' ')}`)
|
promises.push($`sudo ${key === 'pkg-freebsd' || key === 'pkg-termux' ? 'pkg' : key} install ${combined[key].flatMap(x => x.installList).join(' ')}`)
|
||||||
break;
|
break
|
||||||
case 'flatpak':
|
case 'flatpak':
|
||||||
promises.push(forEachSeries(combined[key].flatMap(x => x.installList.flatMap(i => $`sudo ${key} install -y flathub ${i}`))))
|
promises.push(forEachSeries(combined[key].flatMap(x => x.installList.flatMap(i => $`sudo ${key} install -y flathub ${i}`))))
|
||||||
break;
|
break
|
||||||
case 'github': // TODO
|
case 'github': // TODO
|
||||||
break;
|
break
|
||||||
case 'nix-env': // TODO
|
case 'nix-env': // TODO
|
||||||
case 'nix-pkg': // TODO
|
case 'nix-pkg': // TODO
|
||||||
case 'nix-shell': // TODO
|
case 'nix-shell': // TODO
|
||||||
break;
|
break
|
||||||
case 'pacman':
|
case 'pacman':
|
||||||
promises.push($`sudo ${key} -Sy --noconfirm --needed ${combined[key].flatMap(x => x.installList).split(' ')}`)
|
promises.push($`sudo ${key} -Sy --noconfirm --needed ${combined[key].flatMap(x => x.installList).join(' ')}`)
|
||||||
break;
|
break
|
||||||
case 'pkg-darwin':
|
case 'pkg-darwin':
|
||||||
break;
|
break
|
||||||
case 'sbopkg': // TODO
|
case 'sbopkg': // TODO
|
||||||
break;
|
break
|
||||||
case 'script':
|
case 'script':
|
||||||
promises.push(...combined[key].flatMap(x => x.installList.map(i => $`${i}`)))
|
promises.push(...combined[key].flatMap(x => x.installList.join(i => $`${i}`)))
|
||||||
break;
|
break
|
||||||
case 'snap-classic':
|
case 'snap-classic':
|
||||||
promises.push($`sudo snap install --classic ${combined[key].flatMap(x => x.installList).split(' ')}`)
|
promises.push($`sudo snap install --classic ${combined[key].flatMap(x => x.installList).join(' ')}`)
|
||||||
break;
|
break
|
||||||
case 'whalebrew': // TODO
|
case 'whalebrew': // TODO
|
||||||
break;
|
break
|
||||||
case 'xbps':
|
case 'xbps':
|
||||||
promises.push($`sudo xbps-install -S ${combined[key].flatMap(x => x.installList).split(' ')}`)
|
promises.push($`sudo xbps-install -S ${combined[key].flatMap(x => x.installList).join(' ')}`)
|
||||||
break;
|
break
|
||||||
case 'yay':
|
case 'yay':
|
||||||
promises.push($`yay -Sy --noconfirm --needed ${combined[key].flatMap(x => x.installList).split(' ')}`)
|
promises.push($`yay -Sy --noconfirm --needed ${combined[key].flatMap(x => x.installList).join(' ')}`)
|
||||||
break;
|
break
|
||||||
default:
|
default:
|
||||||
console.log(`Unable to find install key instructions for ${key}`)
|
console.log(`Unable to find install key instructions for ${key}`)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
await Promise.all(promises)
|
const installs = await Promise.allSettled(promises)
|
||||||
|
log(`All of the installations have finished`)
|
||||||
|
console.log('Installs:', installs)
|
||||||
}
|
}
|
||||||
|
|
||||||
async function acquireManagerList(type, command) {
|
async function acquireManagerList(type, command) {
|
||||||
|
@ -246,39 +307,8 @@ async function acquireManagerList(type, command) {
|
||||||
return fs.readFileSync(`${cacheDir}/${type}`).toString().split('\n')
|
return fs.readFileSync(`${cacheDir}/${type}`).toString().split('\n')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function pkgMap(pkgDefs) {
|
||||||
async function main() {
|
return pkgDefs
|
||||||
await $`mkdir -p ${cacheDir}`
|
|
||||||
const initData = await Promise.all([
|
|
||||||
getOsInfo(),
|
|
||||||
getSoftwareDefinitions(),
|
|
||||||
getSystemType()
|
|
||||||
])
|
|
||||||
osArch = initData[0].arch
|
|
||||||
osId = process.platform === 'win32' ? 'win32' : (process.platform === 'linux' ? initData[0].id : process.platform)
|
|
||||||
osType = process.platform === 'win32' ? 'windows' : process.platform
|
|
||||||
pkgs = initData[1].softwarePackages
|
|
||||||
sysType = initData[2]
|
|
||||||
installOrder = initData[1].installerPreference
|
|
||||||
const lists = [
|
|
||||||
acquireManagerList('brew', `brew list -1`),
|
|
||||||
acquireManagerList('cargo', `cargo install --list | awk '/^[[:alnum:]]/ {print $1}'`),
|
|
||||||
acquireManagerList('gem', `gem list | awk '{print $1}'`),
|
|
||||||
acquireManagerList('npm', `volta list --format plain | awk '{print $2}' | sed 's/@.*//'`),
|
|
||||||
acquireManagerList('pip3', `pip3 list | awk '{print $1}'`),
|
|
||||||
acquireManagerList('pipx', `pipx list --short | awk '{print $1}'`)
|
|
||||||
]
|
|
||||||
const managerLists = {
|
|
||||||
brew: lists[0],
|
|
||||||
cargo: lists[1],
|
|
||||||
gem: lists[2],
|
|
||||||
npm: lists[3],
|
|
||||||
pip3: lists[4],
|
|
||||||
pipx: lists[5]
|
|
||||||
}
|
|
||||||
const installKeys = Object.keys(pkgs)
|
|
||||||
.filter(i => expandDeps(argv._).includes(i))
|
|
||||||
const installData = installKeys
|
|
||||||
.map(i => {
|
.map(i => {
|
||||||
for (const pref of installOrder[sysType]) {
|
for (const pref of installOrder[sysType]) {
|
||||||
const installKey = getPkgData(pref, pkgs[i], false)
|
const installKey = getPkgData(pref, pkgs[i], false)
|
||||||
|
@ -301,40 +331,100 @@ async function main() {
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.filter(x => x.installKey)
|
.filter(x => x.installKey)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
async function main() {
|
||||||
|
await $`mkdir -p ${cacheDir}`
|
||||||
|
log(`Acquiring software definitions and system information`)
|
||||||
|
const initData = await Promise.all([
|
||||||
|
getOsInfo(),
|
||||||
|
getSoftwareDefinitions(),
|
||||||
|
getSystemType()
|
||||||
|
])
|
||||||
|
osArch = initData[0].arch
|
||||||
|
osId = process.platform === 'win32' ? 'win32' : (process.platform === 'linux' ? initData[0].id : process.platform)
|
||||||
|
osType = process.platform === 'win32' ? 'windows' : process.platform
|
||||||
|
pkgs = initData[1].softwarePackages
|
||||||
|
sysType = initData[2]
|
||||||
|
installOrder = initData[1].installerPreference
|
||||||
|
log(`Populating lists of pre-installed packages`)
|
||||||
|
const lists = [
|
||||||
|
acquireManagerList('brew', `brew list -1`),
|
||||||
|
acquireManagerList('cargo', `cargo install --list | awk '/^[[:alnum:]]/ {print $1}'`),
|
||||||
|
acquireManagerList('gem', `gem list | awk '{print $1}'`),
|
||||||
|
acquireManagerList('npm', `volta list --format plain | awk '{print $2}' | sed 's/@.*//'`),
|
||||||
|
acquireManagerList('pip3', `pip3 list | awk '{print $1}'`),
|
||||||
|
acquireManagerList('pipx', `pipx list --short | awk '{print $1}'`)
|
||||||
|
]
|
||||||
|
const managerLists = {
|
||||||
|
brew: lists[0],
|
||||||
|
cargo: lists[1],
|
||||||
|
cask: lists[0],
|
||||||
|
gem: lists[2],
|
||||||
|
npm: lists[3],
|
||||||
|
pip3: lists[4],
|
||||||
|
pipx: lists[5]
|
||||||
|
}
|
||||||
|
log(`Acquiring installation keys`)
|
||||||
|
const installKeys = Object.keys(pkgs)
|
||||||
|
.filter(i => expandDeps(argv._).includes(i))
|
||||||
|
log(`Constructing installation data`)
|
||||||
|
const installData = pkgMap(installKeys)
|
||||||
|
log(`Filtering install instructions`)
|
||||||
const installInstructions = installData
|
const installInstructions = installData
|
||||||
.filter(x => {
|
.filter(x => {
|
||||||
// Filter out packages already installed by by package managers
|
// Filter out packages already installed by by package managers
|
||||||
return Object.keys(managerLists).includes(x.installType)
|
return !Object.keys(managerLists).includes(x.installType)
|
||||||
})
|
})
|
||||||
.filter(x => {
|
.filter(x => {
|
||||||
// Filter out macOS apps that already have a _app installed
|
// Filter out macOS apps that already have a _app installed
|
||||||
if (x.installType === 'cask') {
|
if (x.installType === 'cask' || (osId === 'darwin' && x._app)) {
|
||||||
const appField = getPkgData('_app', x, x.installType)
|
const appField = getPkgData('_app', x, x.installType)
|
||||||
if (fs.existsSync(`/Applications/${x[appField]}`) || fs.existsSync(`${os.homedir()}/Applications/${x[appField]}`)) {
|
return !(fs.existsSync(`/Applications/${x[appField]}`) || fs.existsSync(`${os.homedir()}/Applications/${x[appField]}`))
|
||||||
return false
|
}
|
||||||
|
return true
|
||||||
|
})
|
||||||
|
.filter(x => {
|
||||||
|
// Filter out packages that already have a bin in the PATH
|
||||||
|
const binField = getPkgData('_bin', x, x.installType)
|
||||||
|
const isArray = Array.isArray(x[binField])
|
||||||
|
if (typeof x[binField] === 'string' || isArray) {
|
||||||
|
if (isArray) {
|
||||||
|
log(`_bin field for ${x.listKey} is an array so the first entry will be used to check`)
|
||||||
|
}
|
||||||
|
return !(which.sync(typeof x[binField] === 'string' ? x[binField] : x[binField][0], { nothrow: true }))
|
||||||
|
}
|
||||||
|
log(`Ignoring _bin check because the _bin field for ${x.listKey} is not a string or array`)
|
||||||
|
return true
|
||||||
|
})
|
||||||
|
.filter(x => {
|
||||||
|
// Filter out packages that do not pass _when check
|
||||||
|
const whenField = getPkgData('_when', x, x.installType)
|
||||||
|
if (x[whenField]) {
|
||||||
|
if (typeof x[whenField] === 'string') {
|
||||||
|
try {
|
||||||
|
execSync(`${x[whenField]}`)
|
||||||
|
return false
|
||||||
|
} catch (e) {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
log(`typeof _when for ${x.listKey} must be a string`)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return true
|
return true
|
||||||
})
|
})
|
||||||
.filter(async x => {
|
console.log(installInstructions)
|
||||||
// Filter out packages that already have a bin in the PATH
|
log(`Running installation routine`)
|
||||||
const binField = getPkgData('_bin', x, x.installType)
|
|
||||||
const binCheck = x[binField] && await which(x[binField], { nothrow: true })
|
|
||||||
return binField ? binCheck : true
|
|
||||||
})
|
|
||||||
.filter(async x => {
|
|
||||||
// Filter out packages that do not pass _when check
|
|
||||||
const whenField = getPkgData('_when', x, x.installType)
|
|
||||||
const whenCheck = x[whenField] && await $`${x[whenField]}`.exitCode == 0
|
|
||||||
return whenField ? whenCheck : true
|
|
||||||
})
|
|
||||||
await installPackages(installInstructions)
|
await installPackages(installInstructions)
|
||||||
const postScripts = installData
|
log(`Running post-install scripts`)
|
||||||
|
/*const postScripts = installData
|
||||||
.flatMap(x => {
|
.flatMap(x => {
|
||||||
const postField = getPkgData('_post', x, x.installType)
|
const postField = getPkgData('_post', x, x.installType)
|
||||||
return (postField && runScript(x.listKey, x[postField])) || Promise.resolve()
|
return (postField && runScript(x.listKey, x[postField])) || Promise.resolve()
|
||||||
})
|
})
|
||||||
await Promise.all(postScripts)
|
await Promise.all(postScripts)*/
|
||||||
}
|
}
|
||||||
|
|
||||||
main()
|
main()
|
||||||
|
|
67
software.yml
67
software.yml
|
@ -100,7 +100,6 @@ installerPreference:
|
||||||
- script
|
- script
|
||||||
- ansible
|
- ansible
|
||||||
- binary
|
- binary
|
||||||
- _deps
|
|
||||||
darwin:
|
darwin:
|
||||||
- whalebrew
|
- whalebrew
|
||||||
- cask
|
- cask
|
||||||
|
@ -117,7 +116,6 @@ installerPreference:
|
||||||
- script
|
- script
|
||||||
- ansible
|
- ansible
|
||||||
- binary
|
- binary
|
||||||
- _deps
|
|
||||||
dnf:
|
dnf:
|
||||||
- flatpak
|
- flatpak
|
||||||
- snap
|
- snap
|
||||||
|
@ -134,7 +132,6 @@ installerPreference:
|
||||||
- script
|
- script
|
||||||
- ansible
|
- ansible
|
||||||
- binary
|
- binary
|
||||||
- _deps
|
|
||||||
freebsd:
|
freebsd:
|
||||||
- pkg
|
- pkg
|
||||||
- go
|
- go
|
||||||
|
@ -142,7 +139,6 @@ installerPreference:
|
||||||
- npm
|
- npm
|
||||||
- gem
|
- gem
|
||||||
- script
|
- script
|
||||||
- _deps
|
|
||||||
pacman:
|
pacman:
|
||||||
- flatpak
|
- flatpak
|
||||||
- snap
|
- snap
|
||||||
|
@ -160,7 +156,6 @@ installerPreference:
|
||||||
- script
|
- script
|
||||||
- ansible
|
- ansible
|
||||||
- binary
|
- binary
|
||||||
- _deps
|
|
||||||
ubuntu:
|
ubuntu:
|
||||||
- snap
|
- snap
|
||||||
- flatpak
|
- flatpak
|
||||||
|
@ -177,7 +172,6 @@ installerPreference:
|
||||||
- script
|
- script
|
||||||
- ansible
|
- ansible
|
||||||
- binary
|
- binary
|
||||||
- _deps
|
|
||||||
windows:
|
windows:
|
||||||
- choco
|
- choco
|
||||||
- scoop
|
- scoop
|
||||||
|
@ -190,7 +184,6 @@ installerPreference:
|
||||||
- script
|
- script
|
||||||
- ansible
|
- ansible
|
||||||
- binary
|
- binary
|
||||||
- _deps
|
|
||||||
zypper:
|
zypper:
|
||||||
- flatpak
|
- flatpak
|
||||||
- snap
|
- snap
|
||||||
|
@ -206,7 +199,6 @@ installerPreference:
|
||||||
- script
|
- script
|
||||||
- ansible
|
- ansible
|
||||||
- binary
|
- binary
|
||||||
- _deps
|
|
||||||
softwarePackages:
|
softwarePackages:
|
||||||
_kde:
|
_kde:
|
||||||
_deps:
|
_deps:
|
||||||
|
@ -7583,7 +7575,7 @@ softwarePackages:
|
||||||
_github: https://github.com/hschmidt/EnvPane
|
_github: https://github.com/hschmidt/EnvPane
|
||||||
_home: https://github.com/hschmidt/EnvPane
|
_home: https://github.com/hschmidt/EnvPane
|
||||||
_name: EnvPane
|
_name: EnvPane
|
||||||
_when:script: '! test -d "$HOME/Library/PreferencePanes/EnvPane.prefPane" && ! test -d "~$HOME/Library/PreferencePanes/EnvPane.prefPane"'
|
_when:script: '! test -d "$HOME/Library/PreferencePanes/EnvPane.prefPane"'
|
||||||
script:darwin: '(cd ~/Library/PreferencePanes && rm -rf EnvPane.prefPane && curl -sL https://github.com/hschmidt/EnvPane/releases/download/releases%2F0.8/EnvPane-0.8.tar.bz2 | tar -xjf -)'
|
script:darwin: '(cd ~/Library/PreferencePanes && rm -rf EnvPane.prefPane && curl -sL https://github.com/hschmidt/EnvPane/releases/download/releases%2F0.8/EnvPane-0.8.tar.bz2 | tar -xjf -)'
|
||||||
skhd:
|
skhd:
|
||||||
_bin: skhd
|
_bin: skhd
|
||||||
|
@ -12803,13 +12795,60 @@ softwarePackages:
|
||||||
ansible:windows: professormanhattan.visualstudio
|
ansible:windows: professormanhattan.visualstudio
|
||||||
cask: visual-studio
|
cask: visual-studio
|
||||||
choco: visualstudio2022community
|
choco: visualstudio2022community
|
||||||
|
aider:
|
||||||
|
_bin: aider
|
||||||
|
_github: https://github.com/paul-gauthier/aider
|
||||||
|
_name: Aider AI Chat
|
||||||
|
pipx: aider-chat
|
||||||
|
poppler:
|
||||||
|
brew: poppler
|
||||||
|
csvkit:
|
||||||
|
brew: csvkit
|
||||||
|
airdrop-cli:
|
||||||
|
_bin: airdrop
|
||||||
|
_github: https://github.com/vldmrkl/airdrop-cli
|
||||||
|
_name: Airdrop CLI
|
||||||
|
brew:darwin: vldmrkl/formulae/airdrop-cli
|
||||||
|
rusty:
|
||||||
|
_bin: rusty
|
||||||
|
_github: https://github.com/zahidkhawaja/rusty
|
||||||
|
_name: Rusty AI CLI
|
||||||
|
_todo: Get cargo crate link once this is resolved https://github.com/zahidkhawaja/rusty/issues/7
|
||||||
|
aifiles:
|
||||||
|
_deps:
|
||||||
|
- pandoc
|
||||||
|
- exiftool
|
||||||
|
- poppler
|
||||||
|
- csvkit
|
||||||
|
_bin: aifiles
|
||||||
|
_github: https://github.com/jjuliano/aifiles
|
||||||
|
_name: AI Files
|
||||||
|
_todo: Implement this when XDG spec is supported so we can store configs in ~/.config
|
||||||
|
npm: aifiles
|
||||||
|
talksheet:
|
||||||
|
_bin: talksheet
|
||||||
|
_github: https://github.com/danthelion/talksheet
|
||||||
|
_name: Talksheet
|
||||||
|
pipx: talksheet
|
||||||
|
tgpt:
|
||||||
|
_bin: tgpt
|
||||||
|
_github: https://github.com/aandrew-me/tgpt
|
||||||
|
_name: Terminal GPT
|
||||||
|
yay: tgpt-bin
|
||||||
|
go: github.com/aandrew-me/tgpt/v2@latest
|
||||||
|
scoop: https://raw.githubusercontent.com/aandrew-me/tgpt/main/tgpt.json
|
||||||
|
ai-shell:
|
||||||
|
_bin: ai
|
||||||
|
_github: https://github.com/BuilderIO/ai-shell
|
||||||
|
_name: AI Shell
|
||||||
|
npm: '@builder.io/ai-shell'
|
||||||
github-runner:
|
github-runner:
|
||||||
_desc: '[GitHub Runner](https://docs.github.com/en/actions/hosting-your-own-runners) is a system that you deploy and manage to execute jobs from GitHub Actions on GitHub.com.'
|
_desc: '[GitHub Runner](https://docs.github.com/en/actions/hosting-your-own-runners) is a system that you deploy and manage to execute jobs from GitHub Actions on GitHub.com.'
|
||||||
_docs: https://docs.github.com/en/actions/hosting-your-own-runners
|
_docs: https://docs.github.com/en/actions/hosting-your-own-runners
|
||||||
_github: https://github.com/actions/runner
|
_github: https://github.com/actions/runner
|
||||||
_home: https://docs.github.com/en/actions/hosting-your-own-runners
|
_home: https://docs.github.com/en/actions/hosting-your-own-runners
|
||||||
_name: GitHub Runner
|
_name: GitHub Runner
|
||||||
_when: '! test -d "$HOME/.local/github-runner"'
|
_when: '! test -d "${XDG_DATA_HOME:-$HOME/.local/share}/github-runner"'
|
||||||
_post: |
|
_post: |
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
# @file GitHub Runner Registration
|
# @file GitHub Runner Registration
|
||||||
|
@ -12830,7 +12869,7 @@ softwarePackages:
|
||||||
#
|
#
|
||||||
# * [Secrets / Environment variables documentation](https://install.doctor/docs/customization/secrets)
|
# * [Secrets / Environment variables documentation](https://install.doctor/docs/customization/secrets)
|
||||||
|
|
||||||
GH_RUNNER_PATH="$HOME/.local/github-runner"
|
GH_RUNNER_PATH="${XDG_DATA_HOME:-$HOME/.local/share}/github-runner"
|
||||||
|
|
||||||
### Check if GitHub runner is installed
|
### Check if GitHub runner is installed
|
||||||
if [ -f "$GH_RUNNER_PATH/config.sh" ]; then
|
if [ -f "$GH_RUNNER_PATH/config.sh" ]; then
|
||||||
|
@ -12890,9 +12929,9 @@ softwarePackages:
|
||||||
ARCHITECTURE="$(uname -m | sed 's/86_//' | sed 's/v7l//')"
|
ARCHITECTURE="$(uname -m | sed 's/86_//' | sed 's/v7l//')"
|
||||||
OS_FAMILY="$(test -d /Applications && echo osx || echo linux)"
|
OS_FAMILY="$(test -d /Applications && echo osx || echo linux)"
|
||||||
curl -sSL "https://github.com/actions/runner/releases/download/$LATEST_VERSION/actions-runner-${OS_FAMILY}-${ARCHITECTURE}-${LATEST_VERSION:1}.tar.gz" > "/tmp/actions-runner-${OS_FAMILY}-${ARCHITECTURE}-${LATEST_VERSION:1}.tar.gz"
|
curl -sSL "https://github.com/actions/runner/releases/download/$LATEST_VERSION/actions-runner-${OS_FAMILY}-${ARCHITECTURE}-${LATEST_VERSION:1}.tar.gz" > "/tmp/actions-runner-${OS_FAMILY}-${ARCHITECTURE}-${LATEST_VERSION:1}.tar.gz"
|
||||||
mkdir -p "$HOME/.local/github-runner"
|
mkdir -p "${XDG_DATA_HOME:-$HOME/.local/share}/github-runner"
|
||||||
tar xzf "/tmp/actions-runner-${OS_FAMILY}-${ARCHITECTURE}-${LATEST_VERSION:1}.tar.gz" -C "$HOME/.local/github-runner"
|
tar xzf "/tmp/actions-runner-${OS_FAMILY}-${ARCHITECTURE}-${LATEST_VERSION:1}.tar.gz" -C "${XDG_DATA_HOME:-$HOME/.local/share}/github-runner"
|
||||||
chown -Rf "$USER" "$HOME/.local/github-runner"
|
chown -Rf "$USER" "${XDG_DATA_HOME:-$HOME/.local/share}/github-runner"
|
||||||
rm -f "/tmp/actions-runner-${OS_FAMILY}-${ARCHITECTURE}-${LATEST_VERSION:1}.tar.gz"
|
rm -f "/tmp/actions-runner-${OS_FAMILY}-${ARCHITECTURE}-${LATEST_VERSION:1}.tar.gz"
|
||||||
vscodium:
|
vscodium:
|
||||||
_bin: codium
|
_bin: codium
|
||||||
|
|
Loading…
Reference in a new issue