Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update missing repo scripts to take file arg, add two data files #354

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions bin/clone-missing-repos.sh
Original file line number Diff line number Diff line change
@@ -1,21 +1,25 @@
#!/bin/bash
#=============================================================================================
#
# Clones all missing repos. Use -p to omit private repos.
# Clones all missing repos. Use -p to omit private repos. Use -f to specify a different file.
#
# Author: Aaron Davis
# Author: Chris Malley (PixelZoom, Inc.)
#
#=============================================================================================

omitPrivateRepos="false"
filename="active-repos" # default file

# parse command line options
while getopts ":p" opt; do
while getopts ":pf:" opt; do
case ${opt} in
p)
omitPrivateRepos="true"
;;
f)
filename="${OPTARG}"
;;
\?)
echo "Invalid option: -$OPTARG" >&2
exit
Expand All @@ -30,13 +34,11 @@ binDir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
cd ${binDir}/../..

if [ ${omitPrivateRepos} == "true" ]; then

# Identify missing repos, public only
missingRepos=`comm -23 <(${binDir}/print-missing-repos.sh) perennial/data/active-repos-private | xargs`
missingRepos=`comm -23 <(${binDir}/print-missing-repos.sh ${filename}) perennial/data/active-repos-private | xargs`
else

# Identify missing repos, public and private
missingRepos=`${binDir}/print-missing-repos.sh | xargs`
missingRepos=`${binDir}/print-missing-repos.sh ${filename} | xargs`
fi

# Clone missing repos
Expand All @@ -50,4 +52,4 @@ do
git clone https://github.com/phetsims/"${repo}".git
fi
( cd ${repo}; git init --template=../phet-info/git-template-dir )
done
done
12 changes: 7 additions & 5 deletions bin/print-missing-repos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#
# Prints a list of repos that are missing from your working copy.
# Requires perennial repo to be checked out at the top-level of your working copy,
# and all other repos to be siblings of perennial.
# and all other repos to be siblings of perennial. Use -f to specify a different file.
#
# Author: Chris Malley (PixelZoom, Inc.)
# Author: Jonathan Olson <jonathan.olson@colorado.edu>
Expand All @@ -14,14 +14,16 @@ binDir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
workingDir=${binDir}/../..
cd ${workingDir}

filename=${1:-"active-repos"} # default file if none specified

# Lists of repo names and files at the top-level of the working copy
activeRepos=`cat ./perennial/data/active-repos | tr -d '\015'`
localRepos=`cat ./perennial/data/${filename} | tr -d '\015'`
workingFiles=`ls -1 .`

# List of file names that are either in active-repos OR in the directory listing (but not both).
# List of file names that are either in top-level of the working copy OR in the directory listing (but not both).
# uniq -u only includes non-duplicate lines
missingFiles=`echo -e "${activeRepos}\n${workingFiles}" | sort | uniq -u`
missingFiles=`echo -e "${localRepos}\n${workingFiles}" | sort | uniq -u`

# List of missing repos. That is, file names that are in active-repos, but not in the directory listing.
# uniq -d only includes duplicate lines
echo -e "${activeRepos}\n${missingFiles}" | sort | uniq -d
echo -e "${localRepos}\n${missingFiles}" | sort | uniq -d
24 changes: 24 additions & 0 deletions data/example-sim
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
assert
axon
babel
brand
chipper
dot
example-sim
simula-rasa
joist
kite
perennial
perennial-alias
phet-core
phetcommon
phetmarks
query-string-machine
scenery
scenery-phet
sherpa
sun
tambo
tandem
twixt
utterance-queue
28 changes: 28 additions & 0 deletions data/scenerystack-all
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
scenery
sun
axon
dot
kite
phet-core
tandem
utterance-queue
tambo
assert
sherpa
query-string-machine
phetcommon
brand
chipper
alpenglow
joist
scenery-phet
twixt
vegas
bamboo
mobius
nitroglycerin
tappi
babel
tangible
perennial
perennial-alias