From fb76f298577c809358bc3442f77ee186cc65789a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jozef=20Steinh=C3=BCbl?= Date: Thu, 8 Aug 2024 12:42:31 +0200 Subject: [PATCH] fix: dump handle dirnames, existing dirs --- .config/zed/settings.json | 56 +++++++++++++++++++++++++++++++++++++++ .local/bin/yarn | 8 ++++++ common/dump.py | 13 ++++++--- goog | 1 + 4 files changed, 75 insertions(+), 3 deletions(-) create mode 100644 .config/zed/settings.json create mode 100755 .local/bin/yarn diff --git a/.config/zed/settings.json b/.config/zed/settings.json new file mode 100644 index 0000000..2f969c1 --- /dev/null +++ b/.config/zed/settings.json @@ -0,0 +1,56 @@ +// Zed settings +// +// For information on how to configure Zed, see the Zed +// documentation: https://zed.dev/docs/configuring-zed +// +// To see all of Zed's default settings without changing your +// custom settings, run the `open default settings` command +// from the command palette or from `Zed` application menu. +{ + "theme": "One Dark", + "ui_font_size": 15, + "buffer_font_size": 14, + // Mine + "format_on_save": "on", + "terminal": { + "font_family": "DejaVuSansM Nerd Font", + "line_height": "standard", + "font_size": 15 + }, + "project_panel": { + "default_width": 320 + }, + // ruby + "lsp": { + "solargraph": { + "initialization_options": { + "diagnostics": true, + "formatting": false + } + } + } + // The following settings have been changed from the upstream defaults to + // improve security and privacy. Here are the upstream defaults, you can + // uncomment them if you like. + // + // "features": { + // // Enable copilot (provided by an online service). + // "copilot": true, + // "inline_completion_provider": "copilot" + // }, + // "assistant": { + // "version": "1", + // // Enable the assistant (provided by an online service). + // "enabled": true + // }, + // "telemetry": { + // // Send debug info like crash reports to Zed Industries. + // "diagnostics": true, + // // Send anonymized usage data like what languages you're using Zed with + // // to Zed Industries. + // "metrics": true + // }, + // "journal": { + // "hour_format": "hour12" + // } +} diff --git a/.local/bin/yarn b/.local/bin/yarn new file mode 100755 index 0000000..9c24903 --- /dev/null +++ b/.local/bin/yarn @@ -0,0 +1,8 @@ +#!/bin/bash + +if [[ $1 == "build" ]]; then + bun run $@ + exit +fi + +bun $@ diff --git a/common/dump.py b/common/dump.py index f679f91..c7deb22 100644 --- a/common/dump.py +++ b/common/dump.py @@ -8,9 +8,16 @@ def dump(stuff: list[str]): for path in glob(expand, recursive=True): normalized_path = path.removeprefix(os.path.expanduser("~/")) - if os.path.isdir(normalized_path) and not os.path.exists(normalized_path): - os.mkdir(normalized_path) - elif os.path.isfile(normalized_path): + if os.path.isdir(path): + if os.path.exists(normalized_path): + shutil.rmtree(normalized_path) + + os.makedirs(normalized_path) + else: + dirname = os.path.dirname(normalized_path) + if dirname: + os.makedirs(dirname, exist_ok=True) + shutil.copy2(path, normalized_path) exit(1) diff --git a/goog b/goog index 6e3a70b..7663c7a 100755 --- a/goog +++ b/goog @@ -9,6 +9,7 @@ from common.util import expand stuff: list[str] = [ *expand("~/.config/{kitty,nvim,openbox,pipewire,tint2,zed}/**"), + "~/.config/starship.toml", "~/.themes/**", *expand("~/.local/bin/{yarn}"), "~/.bashrc",