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
Vladislav
eepm
Commits
68bd51bc
Commit
68bd51bc
authored
Apr 10, 2023
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
play/repack/pack common.sh: use epm tool which for is_command
parent
4d34020d
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
3 additions
and
65 deletions
+3
-65
common.sh
pack.d/common.sh
+1
-20
common.sh
play.d/common.sh
+1
-22
common.sh
repack.d/common.sh
+1
-23
No files found.
pack.d/common.sh
View file @
68bd51bc
...
...
@@ -9,30 +9,11 @@ fatal()
# compatibility layer
# print a path to the command if exists in $PATH
if
which which 2>/dev/null
>
/dev/null
;
then
# the best case if we have which command (other ways needs checking)
# TODO: don't use which at all, it is binary, not builtin shell command
print_command_path
()
{
which
--
"
$1
"
2>/dev/null
}
elif
type
-a
type
2>/dev/null
>
/dev/null
;
then
print_command_path
()
{
type
-fpP
--
"
$1
"
2>/dev/null
}
else
print_command_path
()
{
type
"
$1
"
2>/dev/null |
sed
-e
's|.* /|/|'
}
fi
# check if <arg> is a real command
is_command
()
{
print_command_pat
h
"
$1
"
>
/dev/null
epm tool whic
h
"
$1
"
>
/dev/null
}
# compatibility layer
...
...
play.d/common.sh
View file @
68bd51bc
...
...
@@ -6,33 +6,12 @@ fatal()
exit
1
}
# print a path to the command if exists in $PATH
if
a
=
which which 2>/dev/null
>
/dev/null
;
then
# the best case if we have which command (other ways needs checking)
# TODO: don't use which at all, it is binary, not builtin shell command
print_command_path
()
{
a
=
which
--
"
$1
"
2>/dev/null
}
elif
a
=
type
-a
type
2>/dev/null
>
/dev/null
;
then
print_command_path
()
{
a
=
type
-fpP
--
"
$1
"
2>/dev/null
}
else
print_command_path
()
{
a
=
type
"
$1
"
2>/dev/null |
sed
-e
's|.* /|/|'
}
fi
# check if <arg> is a real command
is_command
()
{
print_command_pat
h
"
$1
"
>
/dev/null
epm tool whic
h
"
$1
"
>
/dev/null
}
eget
()
{
epm tool eget
"
$@
"
...
...
repack.d/common.sh
View file @
68bd51bc
...
...
@@ -7,35 +7,13 @@ fatal()
}
# compatibility layer
# print a path to the command if exists in $PATH
if
a
=
which which 2>/dev/null
>
/dev/null
;
then
# the best case if we have which command (other ways needs checking)
# TODO: don't use which at all, it is binary, not builtin shell command
print_command_path
()
{
a
=
which
--
"
$1
"
2>/dev/null
}
elif
a
=
type
-a
type
2>/dev/null
>
/dev/null
;
then
print_command_path
()
{
a
=
type
-fpP
--
"
$1
"
2>/dev/null
}
else
print_command_path
()
{
a
=
type
"
$1
"
2>/dev/null |
sed
-e
's|.* /|/|'
}
fi
# check if <arg> is a real command
is_command
()
{
print_command_pat
h
"
$1
"
>
/dev/null
epm tool whic
h
"
$1
"
>
/dev/null
}
# compatibility layer
# add realpath if missed
if
!
is_command
realpath
;
then
realpath
()
...
...
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