aboutsummaryrefslogtreecommitdiff
path: root/log.sh
blob: 288c0f4625776ead3ca115ba7e76976bdff71e60 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/bin/bash
#-------------------------------------------------------------------------------
# Copyright (c) 2017, Arm Limited. All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause
#
#-------------------------------------------------------------------------------

if [ ! -e "c:/" ]
then
function cygpath {
	readlink -f "$2"
}
fi

file=`readlink -e ${@:$#:1}`
cmd=`which ${@:1:1}` || cmd=${@:1:1}
cmd=`cygpath -m "$cmd"`
cat <<EOM
{
  "directory": "`cygpath -m "$PWD"`",
  "command": "\"$cmd\" ${@:2:(( $#-1 ))}",
  "file": "`cygpath -m "$file"`"
},
EOM