diff --git a/build.sh b/build.sh index 5a3b652..3b02b4d 100755 --- a/build.sh +++ b/build.sh @@ -1,16 +1,20 @@ -#!/bin/sh +#!/usr/bin/env zsh set -E +setopt extended_glob -DIRS=" +DIRS=( syntax indent ftplugin ftdetect autoload compiler after/syntax after/indent after/ftplugin after/ftdetect -" +) copy_dir() { if [ -d "$1/$2" ]; then - mkdir -p "$2" - cp -r $1/$2/* $2/ + for file in $(find "$1/$2" -name '*.vim'); do + file_path="$(dirname "${file##$1/}")" + mkdir -p "$file_path" + cp $file $file_path/ + done fi } diff --git a/ftplugin/go/test.sh b/ftplugin/go/test.sh deleted file mode 100755 index d8a5b89..0000000 --- a/ftplugin/go/test.sh +++ /dev/null @@ -1,78 +0,0 @@ -#!/bin/bash -e -# -# Copyright 2012 The Go Authors. All rights reserved. -# Use of this source code is governed by a BSD-style -# license that can be found in the LICENSE file. -# -# Tests for import.vim. - -cd $(dirname $0) - -cat > base.go <&1 -n "$1: " - vim -e -s -u /dev/null -U /dev/null --noplugin -c "source import.vim" \ - -c "$1" -c 'wq! test.go' base.go - # ensure blank lines are treated correctly - if ! gofmt test.go | cmp test.go -; then - echo 2>&1 "gofmt conflict" - gofmt test.go | diff -u test.go - | sed "s/^/ /" 2>&1 - fail=1 - return - fi - if ! [[ $(cat test.go) =~ $2 ]]; then - echo 2>&1 "$2 did not match" - cat test.go | sed "s/^/ /" 2>&1 - fail=1 - return - fi - echo 2>&1 "ok" -} - -# Tests for Import - -test_one "Import baz" '"baz".*"bytes"' -test_one "Import io/ioutil" '"io".*"io/ioutil".*"net"' -test_one "Import myc" '"io".*"myc".*"net"' # prefix of a site prefix -test_one "Import nat" '"io".*"nat".*"net"' -test_one "Import net/http" '"net".*"net/http".*"mycorp/foo"' -test_one "Import zoo" '"net".*"zoo".*"mycorp/foo"' -test_one "Import mycorp/bar" '"net".*"mycorp/bar".*"mycorp/foo"' -test_one "Import mycorp/goo" '"net".*"mycorp/foo".*"mycorp/goo"' - -# Tests for Drop - -cat > base.go <&1 "FAIL" - exit 1 -fi -echo 2>&1 "PASS"