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
7cdde317
Commit
7cdde317
authored
Apr 02, 2024
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
epm pack.d/common.sh: add is_url() and add url support to install_file
parent
a7c1bb33
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
1 deletion
+9
-1
common.sh
pack.d/common.sh
+9
-1
No files found.
pack.d/common.sh
View file @
7cdde317
...
@@ -47,6 +47,10 @@ is_abs_path()
...
@@ -47,6 +47,10 @@ is_abs_path()
echo
"
$1
"
|
grep
-q
"^/"
echo
"
$1
"
|
grep
-q
"^/"
}
}
is_url
()
{
echo
"
$1
"
|
grep
-q
"^[filehtps]*:/"
}
is_dir_empty
()
is_dir_empty
()
{
{
...
@@ -111,9 +115,13 @@ install_file()
...
@@ -111,9 +115,13 @@ install_file()
if
is_abs_path
"
$dest
"
;
then
if
is_abs_path
"
$dest
"
;
then
dest
=
".
$dest
"
dest
=
".
$dest
"
fi
fi
mkdir
-p
"
$(
dirname
"
$dest
"
)
"
||
return
mkdir
-p
"
$(
dirname
"
$dest
"
)
"
||
return
if
is_url
"
$src
"
;
then
epm tool eget
-O
"
$dest
"
"
$src
"
||
fatal
"Can't download
$src
to install to
$dest
"
else
cp
"
$src
"
"
$dest
"
||
return
cp
"
$src
"
"
$dest
"
||
return
fi
chmod
0644
"
$dest
"
chmod
0644
"
$dest
"
}
}
...
...
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