Skip to content

Commit

Permalink
1.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
haghish committed Nov 11, 2016
1 parent dfb8ee7 commit e9510d6
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 27 deletions.
38 changes: 23 additions & 15 deletions github.ado
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*** DO NOT EDIT THIS LINE -----------------------------------------------------
Version: 1.0.0
Version: 1.0.1
Title: github
Description: installs Stata packages with a particular version (release) as
well as their dependencies from
Expand Down Expand Up @@ -40,18 +40,30 @@ __github__ simplifies installing Stata packages from
[GitHub](http://www.github.com/) website. The package also allows installing
older releaes of the package using the __version()__ option, a feature that
improves reproducibility of analyses carried out by user-written packages.
Installing package dependencies
===============================
Packages installed by __github__ command can also automatically install the
package dependencies.
For example, the {browse "https://github.com/haghish/MarkDoc":MarkDoc} package
requires two other Stata packages which are
{browse "https://github.com/haghish/weaver":Weaver} and
{browse "https://github.com/haghish/MarkDoc":Statax}.
Usually, users have to install these packages manually after installing
MarkDoc from GitHub or SSC. However, the __github install__ command will look
for a file named __dependency.do__ and executes this file if its exists.
Package developers can simply __write the code required for installing the__
__dependencies in this file__ to take care of the dependencies automatically.
for a file named __dependency.do__ in the repository and executes this file
if it exists.
The __dependency.do__ file will not be copied to the PLUS
directory and is simply executed by Stata after installing the package. It can
include a command for installing dependency packages using __ssc__,
__net install__, or __github install__ commands. The latter is preferable because
it also allows you to specify a particular version for the dependency packages.
Note that the __dependency.do__ file will only be executed by __github install__
command and other installation commands such as __net install__ will not
install the dependencies.
Example(s)
=================
Expand Down Expand Up @@ -79,7 +91,6 @@ This help file was dynamically produced by
***/



*cap prog drop github
prog define github

Expand Down Expand Up @@ -156,6 +167,8 @@ prog define github
macro shift
}

// Installing an archived version
// -----------------------------------------------------------------------
if !missing("`version'") {
local path "https://github.com/`anything'/archive/`version'.zip"

Expand All @@ -181,12 +194,11 @@ prog define github
else {
di as txt "`package' package has no dependency"
}

}
else {
//goes to the current directory path
//local path "https://github.com/`anything'/archive/`version'.zip"


// Installing from the master
// -----------------------------------------------------------------------
else {
net install `package', from("https://raw.githubusercontent.com/`anything'/master/") `replace' `force'

di _n "{title:Checking package dipendencies}"
Expand All @@ -199,12 +211,8 @@ prog define github
else {
di as txt "`package' package has no dependency"
}

}


*di as err "`anything'"

end

*markdoc github.ado, export(sthlp) replace
Expand Down
32 changes: 20 additions & 12 deletions github.sthlp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{smcl}
{right:version 1.0.0}
{right:version 1.0.1}
{title:Title}

{phang}
Expand Down Expand Up @@ -40,19 +40,33 @@ package.
{browse "http://www.github.com/":GitHub} website. The package also allows installing
older releaes of the package using the {bf:version()} option, a feature that
improves reproducibility of analyses carried out by user-written packages.
Packages installed by {bf:github} command can also automatically install the
package dependencies.


{title:Installing package dependencies}

{p 4 4 2}
Packages installed by {bf:github} command can also automatically install the
package dependencies.
For example, the {browse "https://github.com/haghish/MarkDoc":MarkDoc} package
requires two other Stata packages which are
{browse "https://github.com/haghish/weaver":Weaver} and
{browse "https://github.com/haghish/MarkDoc":Statax}.
Usually, users have to install these packages manually after installing
MarkDoc from GitHub or SSC. However, the {bf:github install} command will look
for a file named {bf:dependency.do} and executes this file if its exists.
Package developers can simply {bf:write the code required for installing the}
{bf:dependencies in this file} to take care of the dependencies automatically.
for a file named {bf:dependency.do} in the repository and executes this file
if it exists.

{p 4 4 2}
The {bf:dependency.do} file will not be copied to the PLUS
directory and is simply executed by Stata after installing the package. It can
include a command for installing dependency packages using {bf:ssc},
{bf:net install}, or {bf:github install} commands. The latter is preferable because
it also allows you to specify a particular version for the dependency packages.

{p 4 4 2}
Note that the {bf:dependency.do} file will only be executed by {bf:github install}
command and other installation commands such as {bf:net install} will not
install the dependencies.


{title:Example(s)}
Expand All @@ -67,12 +81,6 @@ Package developers can simply {bf:write the code required for installing the}
. github query haghish/markdoc


{title:Acknowledgements}

{p 4 4 2}
If you have thanks specific to this command, put them here.


{title:Author}

{p 4 4 2}
Expand Down

0 comments on commit e9510d6

Please sign in to comment.