---
language: bash


sudo: false

before_install:
  - echo -e "Host github.com\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config
  - | # epic build time improvement - see https://github.com/elm-lang/elm-compiler/issues/1473#issuecomment-245704142
    if [ ! -d sysconfcpus/bin ];
    then
      git clone https://github.com/obmarg/libsysconfcpus.git;
      cd libsysconfcpus;
      ./configure --prefix=$TRAVIS_BUILD_DIR/sysconfcpus;
      make && make install;
      cd ..;
    fi


install:
  - nvm install 6
  - nvm use 6
  - npm install
  - if [ ! -f node_modules/.bin/elm-make-old ];
    then
      mv node_modules/.bin/elm-make node_modules/.bin/elm-make-old;
      printf '%s\n\n' '#!/bin/bash' 'echo "Running elm-make with sysconfcpus -n 2"' '$TRAVIS_BUILD_DIR/sysconfcpus/bin/sysconfcpus -n 2 elm-make-old "$@"' > $(npm config get prefix)/bin/elm-make;
      chmod +x $(npm config get prefix)/bin/elm-make;
    fi
  - bin/install-elm-format linux
  - export PATH=$PATH:$PWD/bin

script:
  - bin/fetch-configlet
  - bin/configlet .
  - bin/build.sh

cache:
  directories:
    - elm-stuff
    - sysconfcpus

---
language: bash


sudo: false

before_install:
  - echo -e "Host github.com\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config
  - | # epic build time improvement - see https://github.com/elm-lang/elm-compiler/issues/1473#issuecomment-245704142
    if [ ! -d sysconfcpus/bin ];
    then
      git clone https://github.com/obmarg/libsysconfcpus.git;
      cd libsysconfcpus;
      ./configure --prefix=$TRAVIS_BUILD_DIR/sysconfcpus;
      make && make install;
      cd ..;
    fi


install:
  - nvm install 6
  - nvm use 6
  - npm install
  - if [ ! -f node_modules/.bin/elm-make-old ];
    then
      mv node_modules/.bin/elm-make node_modules/.bin/elm-make-old;
      printf '%s\n\n' '#!/bin/bash' 'echo "Running elm-make with sysconfcpus -n 2"' '$TRAVIS_BUILD_DIR/sysconfcpus/bin/sysconfcpus -n 2 elm-make-old "$@"' > $(npm config get prefix)/bin/elm-make;
      chmod +x $(npm config get prefix)/bin/elm-make;
    fi
  - bin/install-elm-format linux
  - export PATH=$PATH:$PWD/bin

script:
  - bin/fetch-configlet
  - bin/configlet lint .
  - bin/build.sh

cache:
  directories:
    - elm-stuff
    - sysconfcpus

Call configlet subcommand on CI
Call configlet subcommand on CI

This changes configlet to pass a subcommand.

For now, we've released a version of configlet which handles both the old command:

    configlet path/to/track

as well as the new command:

    configlet lint path/to/track

This will let us update all the travis files to include the subcommand before we
release the version of configlet that requires the subcommand.
