diff --git a/github.pkg b/github.pkg index 663836d..86e82b1 100644 --- a/github.pkg +++ b/github.pkg @@ -1,9 +1,9 @@ -v 2.0.0 +v 2.0.5 d 'GITHUB': github package manager d d search, install, and manage github packages d -d Distribution-Date: 20190531 +d Distribution-Date: 20200113 d License: MIT d F abspath.ado @@ -15,6 +15,7 @@ F github.ado F github.dlg F github.sthlp F githubcheck.ado +F githubcheckfilename.ado F githubconfirm.ado F githubdb.ado F githubdependency.ado @@ -29,7 +30,3 @@ F githuboutput.ado F githubquery.ado F githubsearch.ado F githubsearchsteps.ado -F make.ado -F make.dlg -F make.sthlp -F makedlg.ado diff --git a/githubcheckfilename.ado b/githubcheckfilename.ado new file mode 100644 index 0000000..04b6f44 --- /dev/null +++ b/githubcheckfilename.ado @@ -0,0 +1,20 @@ +*cap prog drop githubcheckfilename + +program githubcheckfilename + + version 13 + + syntax anything [, filename(str)] + + //check whether the filename exists in other packages + preserve + sysuse githubfiles.dta, clear + qui gen found = strpos(file, "`filename'") + qui keep if found == 1 & packagename != `anything' + local N = _N + if `N' > 0 { + di as err "{bf:`filename'} is used elsewhere. try: {stata github findfile `filename'}" + } + restore + +end diff --git a/githubfiles.dta b/githubfiles.dta index a563435..8368167 100644 Binary files a/githubfiles.dta and b/githubfiles.dta differ diff --git a/make.ado b/make.ado index be1175b..defc048 100644 --- a/make.ado +++ b/make.ado @@ -210,6 +210,9 @@ prog make forval m = 1/`start' { local n : di files[`m'] file write `pkgfile' `"F `n'"' _n + + //check whether the file is unique + githubcheckfilename "`anything'", filename("`n'") } restore } @@ -219,6 +222,9 @@ prog make while !missing("`1'") { if "`1'" != ";" { file write `pkgfile' `"f `1'"' _n + + //check whether the file is unique + githubcheckfilename "`anything'", filename("`n'") } macro shift } diff --git a/make.do b/make.do index 9183bc7..96a182f 100644 --- a/make.do +++ b/make.do @@ -17,7 +17,7 @@ make github, replace toc pkg version(2.0.5) /// "githubdb.ado;githubdependency.ado;githubfiles.dta;" /// "githubhot.ado;githublistpack.ado;githublistpack.sthlp;" /// "githuboutput.ado;githubquery.ado;githubsearch.ado;" /// - "githubmake.ado;githubsearchsteps.ado;") /// + "githubmake.ado;githubsearchsteps.ado;githubcheckfilename.ado") /// ancillary("") diff --git a/stata.toc b/stata.toc index 6a62aa7..6e8d5e9 100644 --- a/stata.toc +++ b/stata.toc @@ -1,4 +1,4 @@ -v 2.0.0 +v 2.0.5 d Materials by E. F. Haghish d University of Göttingen d haghish@med.uni-goettingen.de