Merge pull request #19 from cyplo/windows_configure
Ability to launch common configure script from Windows as well
This commit is contained in:
commit
b76255d2c5
5 changed files with 89 additions and 37 deletions
2
.gitattributes
vendored
2
.gitattributes
vendored
|
@ -1 +1,3 @@
|
|||
*.sh -crlf
|
||||
|
||||
*.zip filter=lfs diff=lfs merge=lfs -text
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
[![Build Status](https://travis-ci.org/cyplo/dotfiles.svg?branch=master)](https://travis-ci.org/cyplo/dotfiles)
|
||||
[![Build status](https://ci.appveyor.com/api/projects/status/s6i314lyti4o1ny1/branch/master?svg=true)](https://ci.appveyor.com/project/cyplo/dotfiles/branch/master)
|
||||
|
||||
My common dotfiles for Linux, Mac and Cygwin
|
||||
|
||||
|
|
|
@ -1,9 +1,16 @@
|
|||
#!/bin/bash
|
||||
|
||||
SUDO=""
|
||||
if [[ -z $NOSUDO ]]; then
|
||||
SUDO="sudo"
|
||||
fi
|
||||
|
||||
echo "using '$SUDO' as sudo"
|
||||
|
||||
set -e
|
||||
echo
|
||||
echo "configuring settings common among OSes"
|
||||
sudo true
|
||||
$SUDO true
|
||||
|
||||
#zsh
|
||||
if [[ -z $DONT_CHANGE_SHELL ]]; then
|
||||
|
@ -13,7 +20,11 @@ fi
|
|||
|
||||
CURL="curl -sSf"
|
||||
|
||||
#submodules
|
||||
if [[ -z $DIR ]]; then
|
||||
echo "please set DIR"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
DIR=`realpath $DIR`
|
||||
echo "using $DIR as the top level directory"
|
||||
cd $DIR
|
||||
|
@ -46,7 +57,7 @@ source ~/.setenv
|
|||
# symlink 'nodejs' as node on some systems
|
||||
# will replace symlink if it exists, but won't replace regular file
|
||||
if [[ ! -f /usr/bin/node ]]; then
|
||||
sudo ln -vfs /usr/bin/nodejs /usr/bin/node
|
||||
$SUDO ln -vfs /usr/bin/nodejs /usr/bin/node
|
||||
fi
|
||||
|
||||
# tools
|
||||
|
@ -62,9 +73,10 @@ mkdir -p ~/.fonts
|
|||
cp -rv "$DIR/fonts" ~/.fonts
|
||||
set +e
|
||||
fc-cache -rv
|
||||
sudo fc-cache -rv
|
||||
$SUDO fc-cache -rv
|
||||
set -e
|
||||
|
||||
if [[ -z $NORUST ]]; then
|
||||
#rust
|
||||
echo "installing rust"
|
||||
RUSTUP_TEMP="/tmp/blastoff.sh"
|
||||
|
@ -84,14 +96,19 @@ else
|
|||
git pull
|
||||
git submodule update --init --recursive
|
||||
fi
|
||||
|
||||
cargo install -f rustfmt
|
||||
fi
|
||||
|
||||
if [[ -z $NOVIM ]]; then
|
||||
echo "\n" | vim +PluginInstall +qa
|
||||
|
||||
cd "$DIR/.vim/bundle/YouCompleteMe/"
|
||||
git submodule update --init --recursive
|
||||
if [[ -z $NORUST ]]; then
|
||||
./install.py --racer-completer --clang-completer
|
||||
else
|
||||
./install.py --clang-completer
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ -z $NO_GO ]]; then
|
||||
export GOPATH="$HOME/go"
|
||||
|
@ -102,12 +119,12 @@ if [[ -z $NO_GO ]]; then
|
|||
fi
|
||||
|
||||
# talks: reveal-md
|
||||
sudo npm install -g reveal-md
|
||||
sudo npm install -g diff-so-fancy
|
||||
$SUDO npm install -g reveal-md
|
||||
$SUDO npm install -g diff-so-fancy
|
||||
|
||||
# vdir syncer
|
||||
echo "installing vdirsyncer"
|
||||
sudo pip install vdirsyncer
|
||||
$SUDO pip install vdirsyncer
|
||||
|
||||
if [[ -z $USER ]]; then
|
||||
USER=`whoami`
|
||||
|
@ -115,7 +132,7 @@ fi
|
|||
|
||||
# normalize npm permissions
|
||||
mkdir -p $HOME/.npm
|
||||
sudo chown $USER $HOME/.npm -R
|
||||
$SUDO chown $USER $HOME/.npm -R
|
||||
|
||||
echo
|
||||
echo "now go ahead and restart"
|
||||
|
|
17
windows_cygwin/build.bat
Normal file → Executable file
17
windows_cygwin/build.bat
Normal file → Executable file
|
@ -1,5 +1,14 @@
|
|||
choco install -y firefox googlechrome wget
|
||||
wget -c https://cygwin.com/setup-x86_64.exe
|
||||
REM cygwin installation
|
||||
setup-x86_64.exe -R "C:\cygwin64" -s http://cygwin.netbet.org/ -q -g -P curl,zsh,git,vim,wget,xz,tar,gawk,bzip2,subversion
|
||||
@echo on
|
||||
choco install -y firefox googlechrome wget notepadplusplus sublimetext3
|
||||
|
||||
wget -c https://cygwin.com/setup-x86_64.exe
|
||||
setup-x86_64.exe -R "C:\cygwin64" -s http://cygwin.netbet.org/ -q -g -P curl,zsh,git,vim,wget,xz,tar,gawk,bzip2,subversion,zlib,fontconfig,clang
|
||||
|
||||
set script_path=%~dp0
|
||||
set repo_path=%script_path%\..\
|
||||
set bash=c:\cygwin64\bin\bash.exe --login -c
|
||||
|
||||
for /f "delims=" %%A in ('%bash% "cd `cygpath $HOMEPATH`/dev/dotfiles && git rev-parse --abbrev-ref HEAD"') do set "branch=%%A"
|
||||
%bash% 'echo "branch is $branch"'
|
||||
%bash% "cp -vr `cygpath $HOMEPATH`/.ssh $HOME/"
|
||||
%bash% "export OUTER_CLONE=`cygpath $repo_path` && $script_path/build_insider.sh"
|
||||
|
|
23
windows_cygwin/build_insider.sh
Executable file
23
windows_cygwin/build_insider.sh
Executable file
|
@ -0,0 +1,23 @@
|
|||
#!/bin/bash
|
||||
|
||||
DOTFILES_PATH="$HOME/dev/dotfiles"
|
||||
mkdir -pv $HOME/dev/
|
||||
rm -fr $DOTFILES_PATH
|
||||
|
||||
git clone "$OUTER_CLONE" "$DOTFILES_PATH"
|
||||
cd "$DOTFILES_PATH"
|
||||
git remote set-url origin git@github.com:cyplo/dotfiles.git
|
||||
git checkout $branch
|
||||
|
||||
export NOSUDO=true
|
||||
export DONT_CHANGE_SHELL=true
|
||||
export NORUST=true
|
||||
export NOVIM=true
|
||||
export NO_GO=true
|
||||
export DIR=$DOTFILES_PATH
|
||||
|
||||
curl https://bootstrap.pypa.io/get-pip.py > /tmp/get-pip.py
|
||||
python /tmp/get-pip.py
|
||||
|
||||
$DIR/common/configure_fresh_system
|
||||
|
Loading…
Reference in a new issue