Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
local-cdn
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
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
eterfund
local-cdn
Commits
4804c61a
Commit
4804c61a
authored
Nov 25, 2017
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add.sh: add --force (remove) support
parent
eeea9c8f
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
4 deletions
+17
-4
add.sh
add.sh
+7
-0
functions.sh
functions.sh
+10
-4
No files found.
add.sh
View file @
4804c61a
...
...
@@ -14,6 +14,12 @@ fi
re
=
'^[0-9\.]+$'
force
=
''
if
[
"
$1
"
=
"-f"
]
||
[
"
$1
"
=
"--force"
]
;
then
force
=
"
$1
"
shift
fi
library
=
"
$1
"
version
=
"
$2
"
main
=
"
$3
"
...
...
@@ -34,6 +40,7 @@ if ! npm view "$library" > /dev/null ; then
exit
1
fi
[
-n
"
$force
"
]
&&
remove_package
"
$library
"
"
$version
"
add_package
"
$library
"
"
$version
"
"
$main
"
"
$main_minified
"
...
...
functions.sh
View file @
4804c61a
...
...
@@ -3,16 +3,22 @@ fatal () {
exit
1
}
remove_package
()
{
local
library
=
"
$1
"
local
version
=
"
$2
"
[
-e
"packages/
$library
/
$version
"
]
||
return
rm
-rf
"packages/
$library
/
$version
"
echo
"Removed old version (packages/
$library
/
$version
)"
}
add_package
()
{
local
library
=
"
$1
"
local
version
=
"
$2
"
local
main
=
"
$3
"
local
minified
=
"
$4
"
#if [ -e "packages/$library/$version" ]; then
# rm -rf "packages/$library/$version"
# echo "Removed old version (packages/$library/$version)"
#fi
if
!
[
-e
"packages/
$library
/
$version
"
]
;
then
create_package_version
"
$library
"
"
$version
"
echo
"Created packages/
$library
/
$version
/package.json"
...
...
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