Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
rglow
friendlyr
Commits
d55df622
Commit
d55df622
authored
Aug 14, 2020
by
Jean-Marie Lepioufle
Browse files
typo
parent
3ec9bc1b
Changes
1
Hide whitespace changes
Inline
Side-by-side
lib/install_friendlyr.R
View file @
d55df622
...
...
@@ -8,7 +8,7 @@
'install_friendlyr
Usage:
install_friendlyr.R -
version <version
> -path <path>
install_friendlyr.R -
branch <branch
> -
r
path <
r
path>
install_friendlyr.R (-h | --help)
install_friendlyr.R --version
...
...
@@ -17,7 +17,7 @@ Options:
--version Show version.
Outcomes:
friendlyr: package friendlyr install with the chosen version.
friendlyr: package friendlyr install
ed
with the chosen version.
'
->
doc
...
...
@@ -28,24 +28,24 @@ arguments <- docopt::docopt(doc, version = 'install_friendlyr version 0.0.1')
cat
(
"Initialising parameters... \n"
)
# init parameters
version
<-
tryCatch
({
res
<-
as.character
(
arguments
$
version
)
branch
<-
tryCatch
({
res
<-
as.character
(
arguments
$
branch
)
res
},
error
=
function
(
err
)
{
print
(
paste
(
"Error in argument '
version
': "
,
err
))
print
(
paste
(
"Error in argument '
branch
': "
,
err
))
print
(
"It will crash."
)
})
# get path
path
<-
tryCatch
({
res
<-
normalizePath
(
file.path
(
as.character
(
arguments
$
path
)),
mustWork
=
FALSE
)
r
path
<-
tryCatch
({
res
<-
normalizePath
(
file.path
(
as.character
(
arguments
$
r
path
)),
mustWork
=
FALSE
)
res
},
error
=
function
(
err
)
{
print
(
paste
(
"Error in argument 'r
esult
': "
,
err
))
print
(
paste
(
"Error in argument 'r
path
': "
,
err
))
print
(
"It will crash."
)
})
cat
(
"Installation... \n"
)
wd
<-
dirname
(
dirname
(
getwd
()))
# install friendlyr
install.packages
(
file.path
(
path
,
paste0
(
'friendlyr_'
,
version
,
'.tar.gz'
)),
repos
=
NULL
,
type
=
'source'
)
install.packages
(
file.path
(
r
path
,
paste0
(
'friendlyr_'
,
branch
,
'.tar.gz'
)),
repos
=
NULL
,
type
=
'source'
)
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