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
Nurlan
eepm
Commits
be173df8
Commit
be173df8
authored
Jul 20, 2015
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
epm-assure: add support for checking any path on a file system
parent
606165ed
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
0 deletions
+32
-0
epm-assure
bin/epm-assure
+32
-0
No files found.
bin/epm-assure
View file @
be173df8
...
...
@@ -23,6 +23,21 @@ __check_command_in_path()
}
# copied from strings
# CHECKME: the same like estrlist has ?
# Note: used egrep! write '[0-9]+(first|two)', not '[0-9]\+...'
rhas
()
{
echo
"
$1
"
| egrep
-q
--
"
$2
"
}
# copied from strings
is_dirpath
()
{
[
"
$1
"
=
"."
]
&&
return
$?
rhas
"
$1
"
"/"
}
# Do fast checking for command and install package if the command does not exist
# $1 - command name
...
...
@@ -30,6 +45,23 @@ __check_command_in_path()
__epm_assure
()
{
if
is_dirpath
"
$1
"
;
then
if
[
-r
"
$1
"
]
;
then
if
[
-n
"
$verbose
"
]
;
then
info
"File
$1
is exists."
epm qf
"
$1
"
fi
return
0
fi
[
-n
"
$2
"
]
||
fatal
"You need run with package name param when use with absolute path"
# TODO: below we install in some semimanual way
docmd epm
--auto
--skip-installed
install
"
$2
"
return
fi
if
__check_command_in_path
"
$1
"
>
/dev/null
;
then
if
[
-n
"
$verbose
"
]
;
then
local
compath
=
"
$(
__check_command_in_path
"
$1
"
)
"
...
...
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