-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Mostly renames but starting to get ready for setting up via PATH (bas…
…ically a reset) or a local Dotfiles repo
- Loading branch information
Showing
17 changed files
with
113 additions
and
144 deletions.
There are no files selected for viewing
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,9 @@ | ||
#!/bin/zsh | ||
# | ||
# setup-macos.sh - the macOS version | ||
source "$DOTFILES_ROOT/Mac/dot-functions.sh" | ||
|
||
# TODO: This needs to adapt to whether this is a FRESH install or re-run from PATH | ||
source "$DOTFILES_ROOT/Mac/Root/dot-functions.sh" | ||
echo | ||
message "setup-macos.sh -- setting up for macOS via ${DOTFILES_ROOT}" | ||
|
||
|
@@ -48,47 +50,44 @@ sudo chmod 766 $HOME/Developer | |
sudo chmod 777 /opt/homebrew/bin | ||
sudo chmod 777 /usr/local/bin | ||
|
||
|
||
# ============================================================================== | ||
message "Copying scripts into ~/Developer" "These scripts are now in PATH" | ||
# Put some files in these directories just to validate | ||
cp ${DOTFILES_ROOT}/readme.md $HOME/Developer | ||
|
||
# ============================================================================== | ||
message "Copying dotfiles" "Overwriting existing versions of these files" | ||
cp $DOTFILES_ROOT/Mac/dot-zshrc.sh $HOME/.zshrc | ||
cp $DOTFILES_ROOT/Mac/dot-zshenv.sh $HOME/.zshenv | ||
cp $DOTFILES_ROOT/Mac/dot-aliases.sh $HOME/.aliases | ||
cp $DOTFILES_ROOT/Mac/dot-functions.sh $HOME/.functions | ||
# Don't copy with -R for the primary PATH files | ||
cp -R $DOTFILES_ROOT/Mac/* $HOME/Developer/ | ||
|
||
|
||
# Copy app preferences | ||
cp $DOTFILES_ROOT/Mac/Preferences/* $HOME/Library/Preferences/ | ||
|
||
# TODO: FEATURE - Install from ~/Developer if run from PATH, or DOTFILES if fresh install | ||
|
||
# ============================================================================== | ||
message "Installing root dotfiles" "Overwriting existing versions of these files" | ||
cp $DOTFILES_ROOT/Mac/Root/dot-zshrc.sh $HOME/.zshrc | ||
cp $DOTFILES_ROOT/Mac/Root/dot-zshenv.sh $HOME/.zshenv | ||
cp $DOTFILES_ROOT/Mac/Root/dot-aliases.sh $HOME/.aliases | ||
cp $DOTFILES_ROOT/Mac/Root/dot-functions.sh $HOME/.functions | ||
|
||
# Copy Git and other config files | ||
cp $DOTFILES_ROOT/Mac/dot-gitconfig $HOME/.gitconfig | ||
cp $DOTFILES_ROOT/Mac/dot-gitignore $HOME/.gitignore | ||
cp $DOTFILES_ROOT/Mac/dot-vimrc $HOME/.vimrc | ||
cp $DOTFILES_ROOT/Mac/Root/dot-gitconfig $HOME/.gitconfig | ||
cp $DOTFILES_ROOT/Mac/Root/dot-gitignore $HOME/.gitignore | ||
cp $DOTFILES_ROOT/Mac/Root/dot-vimrc $HOME/.vimrc | ||
|
||
# Register gitignore and other git stuff | ||
git config --global core.excludesfile ~/.gitignore | ||
|
||
message "Installing app preferences" "Overwriting Terminal, Xcode, and other settings" | ||
# Copy app settings | ||
cp $DOTFILES_ROOT/Mac/Preferences/* $HOME/Library/Preferences/ | ||
|
||
# Copy Xcode preferences | ||
mkdir -p $HOME/Library/Developer/Xcode/UserData/FontAndColorThemes | ||
cp -R $DOTFILES_ROOT/Mac/Xcode/* $HOME/Library/Developer/Xcode/UserData/FontAndColorThemes/ | ||
|
||
|
||
|
||
# ============================================================================== | ||
message "Copying scripts into ~/Developer" "These scripts are now in PATH" | ||
cp -R $DOTFILES_ROOT/Mac/Demos/* $HOME/Developer/ | ||
cp -R $DOTFILES_ROOT/Mac/Scripts/* $HOME/Developer/ | ||
# Don't copy with -R for the root files, to avoid copyin | ||
cp $DOTFILES_ROOT/Mac/* $HOME/Developer/ | ||
|
||
# These files are copied into Developer subfolders, not into the PATH | ||
mkdir -p $HOME/Developer/Settings | ||
cp -R $DOTFILES_ROOT/Mac/Settings/* $HOME/Developer/Settings/ | ||
|
||
mkdir -p $HOME/Developer/Xcode | ||
cp -R $DOTFILES_ROOT/Mac/Xcode/* $HOME/Developer/Xcode/ | ||
|
||
|
||
|
||
# ============================================================================== | ||
|
@@ -156,8 +155,8 @@ echo | |
message "Restart terminal" "After restart, you can run the following commands:" | ||
bullet "git config --global user.name \"Your Name\"" | ||
bullet "git config --global user.email \"[email protected]\"" | ||
bullet "install-brew.sh <-- install and setup Homebrew" | ||
bullet "install-ruby.sh <-- install a newer version of Ruby via Homebrew" | ||
bullet "setup-brew.sh <-- install or update Homebrew" | ||
bullet "setup-ruby.sh <-- setup a newer version (or update) of Ruby via Homebrew" | ||
echo | ||
|
||
exit 0 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
#!/bin/zsh | ||
# | ||
# setup-ruby.sh -- macOS version (simple version, installs latest) | ||
|
||
source ${HOME}/.functions | ||
message "setup-ruby.sh" "Running [brew install ruby] instead of [rbenv]" | ||
bullet "The latest Ruby is installed via this script and put first in PATH" | ||
|
||
which -s brew | ||
if [[ $? != 0 ]] ; then | ||
error "Missing Homebrew" "Must first install Homebrew before installing Ruby" | ||
exit 0 | ||
fi | ||
|
||
brew install ruby | ||
|
||
# Update to the latest version of Ruby Gems installers | ||
sudo gem update | ||
|
||
|
||
|
||
# TODO: the below may require Terminal is restarted one before it succeeds? | ||
|
||
# ============================================================================== | ||
# Install some gems (Jekyll and Bundler to start) | ||
which -s bundler &> /dev/null | ||
if [[ $? != 0 ]] ; then | ||
bullet "Installing Bundler" "Installing the Bundler gem for the first time" | ||
sudo gem install bundler | ||
else | ||
message "Updating Bundler" "Updating the Bundler gem to latest version" | ||
sudo gem update bundler | ||
fi | ||
|
||
which -s jekyll &> /dev/null | ||
if [[ $? != 0 ]] ; then | ||
bullet "Installing Jekyll" "Installing the Jekyll gem for the first time" | ||
sudo gem install jekyll | ||
else | ||
bullet "Updating Jekyll" "Updating the Jekyll gem to latest version" | ||
sudo gem update jekyll | ||
fi | ||
|
||
|
||
|
||
# ============================================================================== | ||
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,38 +2,39 @@ | |
|
||
Documentation for these `dotfiles` can be [found here](https://timtr.github.io/Dotfiles/Docs/). | ||
|
||
On a Mac, first install Xcode or the command line tools package. Then run: | ||
On a Mac, first install Xcode or the command line tools, then run: | ||
|
||
``` | ||
git clone https://github.com/timtr/Dotfiles.git | ||
cd Dotfiles | ||
./setup.sh | ||
``` | ||
|
||
Alternately, type `./setup.sh reset` to override custom files like `./local.sh` and to blow-away settings for tools like Xcode that you may otherwise not want to modify. | ||
You can also type `./setup.sh reset` to override custom files like `./local.sh` and to blow-away settings for tools like Xcode that you may otherwise not want to modify. | ||
|
||
Run `setup.sh` from within a local `Dotfiles` folder instance. Once installed, quit Terminal and relaunch. Finish install by typing: | ||
The first install requires that you run `setup.sh` from within the local `Dotfiles` folder. Once installed, quit Terminal and relaunch. Finish install by typing: | ||
|
||
``` | ||
git config --global user.name "Your Name" | ||
git config --global user.email "[email protected]" | ||
install-brew.sh | ||
install-ruby.sh | ||
setup-brew.sh | ||
setup-ruby.sh | ||
``` | ||
|
||
A tool called `help.sh` is runable from the shell for additional help. | ||
Once installed, a tool called `help.sh` is runable from the PATH for additional help. | ||
|
||
|
||
## Features | ||
|
||
Files ending in .sh are often renamed to be prefix by a `"."` with the `.sh` extension removed. This makes these files easier to edit during creation of this project, and also makes it clear which are "source" versions of these files, versus the installed versions. | ||
**local.sh** - Installs a file called `~/local.sh` (if doesn't exist) that you can customize with settings that do not belong checked into GitHub, for instance set certain keys, or environment variables. This is also the file to add things like feature flags during development, add a Swift toolchain, or to enable secret build settings. | ||
|
||
**ZSH settings** - sets up the prompt, `PATH`, and other basic settings. Note that `.zshenv` sets up the PATH so it works even when there is no interactive terminal session, and `.zshrc` will source this file for a consistent PATH for terminal windows. | ||
|
||
**local.sh** - Installs a file called `~/local.sh` (if doesn't exist) that you can customize with settings that do not belong checked into GitHub, for instance set certain keys, or environment variables. This is also the file to add things like feature flags during development, add a Swift toolchain, or to enable secret build settings. | ||
Files ending in `.sh` are often renamed to have a "dot" prefix and no extension (`.sh` removed). The the `.sh` extension hints to text editors to highlight like a shell script, and also makes it clear which are "source" versions of these files, versus the installed no-extension versions. | ||
|
||
|
||
### Other smaller features | ||
### Other small features | ||
|
||
- Creates a symlink from ~/Dropbox to the new ~/Library/CloudStorage directory if it exists | ||
|
||
|
@@ -48,20 +49,10 @@ For reference, `zsh` config files are loaded in the following order: | |
.zprofile -- if login (not using this file in current setup) | ||
``` | ||
|
||
### Known Issues and ToDo items | ||
|
||
- TODO: report the current `git config --global user.name "your name"` info, or if not set then report how to set it. Same for the setting for `git config --global user.email \"[email protected]\"` | ||
|
||
|
||
|
||
## Setup a custom Swift toolchain | ||
|
||
You can download new Swift toolchains from [Swift.org](https://swift.org/download/#snapshots) and set them up to be used by default. There is a new alias installed by these dotfiles called `swift-alt` that will run the `swift` command line interface using the alternate toolchain, once installed. | ||
|
||
This dotfiles install will install a file called `.swift-settings.sh` at the user's root, enabling feature flags and adding the `swift-alt` alias. You will likely need to edit this file to enter the bundle ID of the installed toolchain you would like to use. As a result, the dotfiles `setup.sh` script will not overwrite this file once installed, so as to not blow away your customizations. If you want to re-install this file, simply delete it and re-run the dotfiles `setup.sh` to install a fresh version. | ||
|
||
To get the correct toolchain bundle ID, in the format `org.swift.cXXXXXXX` you will need to go to the folder `/Library/Something/Toolchains` after installed, show package contents of one of the toolchains, and open the `Info.plist` file. From there, you should see a Bundle ID entry, matching the format. | ||
|
||
You can download new Swift toolchains from [Swift.org](https://swift.org/download/#snapshots) and set them up to be used by default. The `~/local.sh` file is perfect to place to configure these settings rather than make the changes to the main Dotfile repo since it is likely to be a per-machine configuration. | ||
|
||
|
||
## Overview | ||
|
@@ -72,14 +63,14 @@ The scripts are designed to work in `zsh`, although they rarely use advanced fea | |
|
||
The setup will create a custom folder `$HOME/bin/` that is added to the PATH variable and useful for putting random stuff in the path. For Homebrew and related tools support, it also adds `/usr/local/bin` (for Intel) and `/opt/homebrew/bin` (for Apple) to the PATH. | ||
|
||
There are a few aliases added that make it easy to install Homebrew and other tools, rather than trying to do the installs directly from `setup.sh`. Mostly this is because the install is a multi-step process, and it is just a lot easier to run the full setup, then manually type `install-brew` when everything else looks to be working. | ||
There are a few aliases added that make it easy to install Homebrew and other tools, rather than trying to do the installs directly from `setup.sh`. Mostly this is because the install is a multi-step process, and it is just a lot easier to run the full setup, then manually type `setup-brew.sh` when everything else looks to be working. | ||
|
||
|
||
## Demos | ||
|
||
Once installed, you can install Homebrew and run demos. For example, run `demo-homebrew.sh` from the PATH to show a Terminal screen of software being downloaded, built, installed, and erased (in a repeating loop). Hit `CONTROL-Z` to quit that demo. | ||
Once installed, you can install Homebrew and run demos. For example, run `demo-homebrew.sh` from the PATH to show a Terminal screen of software being downloaded, built, installed, and erased (in a repeating loop). Hit `CONTROL-Z` to quit that demo. | ||
|
||
You can also open the `./Developer/demo-safari-cycle.html` file to launch Safari and begin cycling through many web pages, implying a sort of automated web test harness. | ||
You can also open the `~/Developer/demo-safari-cycle.html` file to launch Safari and begin cycling through many web pages, implying a sort of automated web test harness. | ||
|
||
|
||
## License | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.