Newer
Older
migrate = require("./migrate/migrate"),
updateNodeVersion = require("./update-version/update-node-version");
shell.set('-e'); // exit upon first error
.=*#%%#*= -*#%%#*=. =+- ++. .+ .+#%%#+. :++ -+-
:@@=:..:+@@. #@#:..:+@@. *@* @@: -@#@+:..-@@- -@@ *@*
+@* %@= .@@. %@= *@* @@: -@@. *@* -@@ *@*
+@* %@= %@* *%= *@* @@: -@@ *@* -@@ *@*
+@* %@= +@@= *@* @@: -@@ *@* -@@ *@*
+@* %@= .+@@+. *@* @@: -@@ *@* -@@ *@*
+@* %@= .+@@+. *@* @@: -@@ *@* .@@=. :@@=
+@* %@= == +@@: *@* @@: -@@ *@* .+%@@@@%*-
+@* %@= .@@. +@# *@* .@@: -@@ *@* @@-
=@% .@@- @@- #@# +@# :#@@: -@@ *@* @@-
=%@%##%@%= :#@%##%@@* *@@##@%=:@: :@@ *@+ %@-
.:.. ..:. ...
let pagefindExclude = '';
// Categories: No list of categories
pagefindExclude += '.categories__taxonomy, .categories__term, ';
pagefindExclude += '.posts_categories__taxonomy, .posts_categories__term, ';
pagefindExclude += '.events_categories__taxonomy, .events_categories__term, ';
// Diplomas: No list of diplomas or block diplomas
pagefindExclude += '.diplomas__taxonomy, .block-diplomas, ';
// Agenda events: No list of events or block events
pagefindExclude += '.events__section, .block-agenda, ';
// Organizations: No list of organizations or block organizations
pagefindExclude += '.organizations__section, .block-organizations, ';
// Pages: No block pages (there's no difference between list and page)
pagefindExclude += '.block-pages, ';
// Persons: no list or block
pagefindExclude += '.persons__section, .block-persons, ';
// No list of people's facets
pagefindExclude += '.administrators__term, .authors__term, .researchers__term, .teachers__term,';
// Posts: no list, block posts, or post sidebar
pagefindExclude += '.posts__section, .block-posts, .post-sidebar, ';
// Programs: no block
pagefindExclude += '.block-programs';
function execute(string) {
console.log("OSUNY runs " + string);
execute("npx pagefind --site 'public' --output-subdir '../static/pagefind' --glob '**/index.{html}' --exclude-selectors '" + pagefindExclude + "'");
if (command === "local") {
var IP = dev.network["en0"][0] || "0.0.0.0";
execute("hugo");
execute("npx pagefind --site 'public' --output-subdir '../static/pagefind' --glob '**/index.{html}' --exclude-selectors '" + pagefindExclude + "'");
execute("hugo server --bind=" + IP + " --baseURL=http://" + IP + ":1313 -D");
}
execute("yarn upgrade osuny");
execute("yarn install");
execute("npm_config_yes=true npx pagefind --site 'public' --glob '**/index.{html}' --exclude-selectors '" + pagefindExclude + "'");
if (command === "percy-build") {
execute("yarn upgrade");
execute("hugo --baseURL=/");
execute("npm_config_yes=true npx pagefind --site 'public' --glob '**/index.{html}' --exclude-selectors '" + pagefindExclude + "'");
execute("git pull --recurse-submodules --depth 1");
execute("git submodule update --remote");
execute("git submodule add https://github.com/noesya/osuny-example");
execute("hugo server --config osuny-example/config/example/config.yaml");
execute("yarn setup-example > /dev/null || yarn upgrade");
execute("yarn osuny server-example");
execute("git submodule update --remote");
if (command === "migrate") {
migrate(process.argv);
}