Skip to content

Instantly share code, notes, and snippets.

@motorro
Created March 12, 2020 16:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save motorro/ba9e7aeb902111d754c7f9cce7fe605e to your computer and use it in GitHub Desktop.
Save motorro/ba9e7aeb902111d754c7f9cce7fe605e to your computer and use it in GitHub Desktop.
Pre-populating gulp task
/**
* City population
*/
exports.cities = async () => {
const options: Args = minimist<Args>(
process.argv.slice(2),
{
string: ["dataDir"],
default: { dataDir: "_data"}
}
);
// 1. Create database
const pathToNewDb = await cities(SCHEMA_PATH, options.dataDir);
// 2. Copy to assets
fs.copyFileSync(pathToNewDb, DST_PATH);
// 3. Increment version
incrementDatabaseVersion(VERSION_PATH, VERSION_KEY);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment