tests/test-check-execute.t
author Jun Wu <quark@fb.com>
Wed, 28 Jun 2017 06:49:01 -0700
changeset 33117 6ef5f0c95d64
parent 33116 6c113a7dec52
child 33204 ddd65b4f3ae6
permissions -rw-r--r--
setup: fix localhgenv It should return env as a dict instead of None.

#require test-repo execbit

  $ . "$TESTDIR/helpers-testrepo.sh"
  $ cd "`dirname "$TESTDIR"`"

look for python scripts without the execute bit

  $ syshg files 'set:**.py and not exec() and grep(r"^#!.*?python")'
  [1]

look for python scripts with execute bit but not shebang

  $ syshg files 'set:**.py and exec() and not grep(r"^#!.*?python")'
  [1]

look for shell scripts with execute bit but not shebang

  $ syshg files 'set:**.sh and exec() and not grep(r"^#!.*(ba)?sh")'
  [1]

look for non scripts with no shebang

  $ syshg files 'set:exec() and not **.sh and not **.py and not grep(r"^#!")'
  [1]