From 70606f95ffbe95b032edd186387bc00cf77229a3 Mon Sep 17 00:00:00 2001 From: Benjamin Sago Date: Wed, 26 Sep 2018 21:25:50 +0100 Subject: [PATCH] Change user in Vagrantfile Why I have to keep doing this I have no idea. If you know, please tell! --- Vagrantfile | 17 +++++++++-------- devtools/dev-help.sh | 2 +- devtools/dev-package-for-linux.sh | 2 +- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/Vagrantfile b/Vagrantfile index 9f7b72a..6e88874 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -21,7 +21,7 @@ Vagrant.configure(2) do |config| # Make sure we know the VM image’s default user name. The ‘cassowary’ user # (specified later) is used for most of the test *output*, but we still # need to know where the ‘target’ and ‘.cargo’ directories go. - developer = 'ubuntu' + developer = 'vagrant' # Install the dependencies needed for exa to build, as quietly as @@ -92,15 +92,15 @@ Vagrant.configure(2) do |config| config.vm.provision :shell, privileged: false, inline: <<-EOF set -xe - if [ -d /home/ubuntu/git2-rs ]; then - cd /home/ubuntu/git2-rs + if [ -d /home/#{developer}/git2-rs ]; then + cd /home/#{developer}/git2-rs git pull https://github.com/ogham/git2-rs.git || echo "Failed to update git2-rs fork" else - git clone https://github.com/ogham/git2-rs.git /home/ubuntu/git2-rs + git clone https://github.com/ogham/git2-rs.git /home/#{developer}/git2-rs fi - mkdir -p /home/ubuntu/.cargo - echo 'paths = ["/home/ubuntu/git2-rs/libgit2-sys"]' > /home/ubuntu/.cargo/config + mkdir -p /home/#{developer}/.cargo + echo 'paths = ["/home/#{developer}/git2-rs/libgit2-sys"]' > /home/#{developer}/.cargo/config EOF # This fix is applied by changing the VM rather than changing the @@ -119,7 +119,7 @@ Vagrant.configure(2) do |config| bash /vagrant/devtools/dev-help.sh > /etc/motd # Tell bash to execute a bunch of stuff when a session starts - echo "source /vagrant/devtools/dev-bash.sh" > /home/ubuntu/.bash_profile + echo "source /vagrant/devtools/dev-bash.sh" > /home/#{developer}/.bash_profile # Disable last login date in sshd sed -i '/PrintLastLog yes/c\PrintLastLog no' /etc/ssh/sshd_config @@ -443,9 +443,10 @@ Vagrant.configure(2) do |config| echo "this file gets moved" > moves/hither git add edits moves + git config --global user.email "exa@exa.exa" + git config --global user.name "Exa Exa" git commit -m "Automated test commit" - echo "modifications!" | tee edits/{staged,both} touch additions/{staged,edited} mv moves/{hither,thither} diff --git a/devtools/dev-help.sh b/devtools/dev-help.sh index b56cd75..4e53467 100644 --- a/devtools/dev-help.sh +++ b/devtools/dev-help.sh @@ -6,7 +6,7 @@ echo -e " \033[1;33mThe exa development environment!\033[0m exa's source is available at \033[33m/vagrant\033[0m. -Binaries get built into \033[33m/home/ubuntu/target\033[0m. +Binaries get built into \033[33m/home/vagrant/target\033[0m. \033[4mCommands\033[0m \033[32;1mexa\033[0m to run the built version of exa diff --git a/devtools/dev-package-for-linux.sh b/devtools/dev-package-for-linux.sh index 8c33e2d..146b325 100644 --- a/devtools/dev-package-for-linux.sh +++ b/devtools/dev-package-for-linux.sh @@ -45,7 +45,7 @@ rm -vf "$exa_linux_binary" cargo build --release --manifest-path "$toml_file" cargo test --release --manifest-path "$toml_file" --lib -- --quiet /vagrant/xtests/run.sh --release -cp /home/ubuntu/target/release/exa "$exa_linux_binary" +cp /home/vagrant/target/release/exa "$exa_linux_binary" # Stripping the binary before distributing it removes a bunch of debugging # symbols, saving some space.