Skip to content

Commit

Permalink
Merge pull request #23 from worldbank/fix_find_src
Browse files Browse the repository at this point in the history
add NotInstalled if povcalnet source not found
  • Loading branch information
randrescastaneda committed Jul 21, 2020
2 parents 8778e47 + 0f73c9a commit f8e7e0a
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions povcalnet.ado
Original file line number Diff line number Diff line change
Expand Up @@ -624,11 +624,15 @@ qui {
// find line where the package is used
levelsof n if regexm(v1, "`cmd'.pkg"), sep(,) loca(pklines)

// the latest source and substract which refers to the source
local sourceline = max(0, `pklines') - 1
if (`"`pklines'"' == `""') local src = "NotInstalled"
else {

// get the Soruce without the initial S
if regexm(v1[`sourceline'], "S (.*)") local src = regexs(1)
// the latest source and substract which refers to the source
local sourceline = max(0, `pklines') - 1

// get the Soruce without the initial S
if regexm(v1[`sourceline'], "S (.*)") local src = regexs(1)
}

// return info
return local src = "`src'"
Expand Down

0 comments on commit f8e7e0a

Please sign in to comment.