Skip to content

Commit

Permalink
Revert accidental commit "cleanup"
Browse files Browse the repository at this point in the history
This reverts commit 80cd069.
  • Loading branch information
bjornreppen committed Sep 13, 2023
1 parent 80cd069 commit 8a316c7
Showing 1 changed file with 2 additions and 19 deletions.
21 changes: 2 additions & 19 deletions stages/download/inn_kommune.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,4 @@
const { config, http, processes } = require("@artsdatabanken/lastejobb")
const path = require('path')

async function untar(tarFileName) {
const isGzipped = path.extname(tarFileName) === '.gz'
await processes.exec('tar', [
'-xvf' + (isGzipped ? 'z' : ''), config.getTempPath(tarFileName),
'--one-top-level',
'-C ' + config.getTempPath(),
]);
}

async function downloadAndUntar(url) {
const tarFileName = path.basename(new URL(url).pathname);
await http.downloadBinary(url, tarFileName);
untar(tarFileName)
}
const { git } = require("@artsdatabanken/lastejobb")

// Download "Natur i Norge" data kildedata - fylke og kommune
//git.clone("https://github.com/Artsdatabanken/kommune.git", "temp/kommune")
downloadAndUntar("https://github.com/Artsdatabanken/kommune/releases/latest/download/artifacts.tar")
git.clone("https://github.com/Artsdatabanken/kommune.git", "temp/kommune")

0 comments on commit 8a316c7

Please sign in to comment.