Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
eepm
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
etersoft
eepm
Commits
657ba476
Commit
657ba476
authored
Aug 03, 2012
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add check_tty, print command in stderr
parent
38f4c705
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
3 deletions
+10
-3
epm
bin/epm
+1
-0
epm-sh-functions
bin/epm-sh-functions
+9
-3
No files found.
bin/epm
View file @
657ba476
...
...
@@ -30,6 +30,7 @@ load_helper epm-sh-functions
set_sudo
check_tty
#############################
...
...
bin/epm-sh-functions
View file @
657ba476
...
...
@@ -27,11 +27,17 @@ isatty()
test
-t
1
}
check_tty
()
{
isatty
||
return
export
USETTY
=
1
}
:
${
BLACK
:
=0
}
${
RED
:
=1
}
${
GREEN
:
=2
}
${
YELLOW
:
=3
}
${
BLUE
:
=4
}
${
MAGENTA
:
=5
}
${
CYAN
:
=6
}
${
WHITE
:
=7
}
set_boldcolor
()
{
isatty
||
return
[
-n
"
$USETTY
"
]
||
return
{
echo
bold
echo
setaf
$1
...
...
@@ -40,7 +46,7 @@ set_boldcolor()
restore_color
()
{
isatty
||
return
[
-n
"
$USETTY
"
]
||
return
{
echo
op
;
# set Original color Pair.
echo
sgr0
;
# turn off all special graphics mode (bold in our case).
...
...
@@ -77,7 +83,7 @@ showcmd()
[
"
$UID
"
=
0
]
&&
PROMTSIG
=
"#"
echo
"
$PROMTSIG
$@
"
restore_color
fi
fi
>
&2
}
# Print command line and run command line
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment