Skip to content

Instantly share code, notes, and snippets.

@gavvvr
Created May 7, 2023 21:48
Show Gist options
  • Save gavvvr/d9b60ccf306db1fa9d327b1c495055fa to your computer and use it in GitHub Desktop.
Save gavvvr/d9b60ccf306db1fa9d327b1c495055fa to your computer and use it in GitHub Desktop.
Download source codes of all obsidian community plugins
const https = require('https')
const { spawn } = require('child_process')
const url =
'https://raw.githubusercontent.com/obsidianmd/obsidian-releases/master/community-plugins.json'
https.get(url, (res) => {
let data = []
res.on('data', (chunk) => {
data.push(chunk)
})
res.on('end', () => {
const plugins = JSON.parse(Buffer.concat(data).toString())
for (const plugin of plugins) {
const repo = `https://github.com/${plugin.repo}`
console.log(`Cloning: ${repo}`)
spawn('git', ['clone', repo, plugin.repo.replace('/', '-')], { stdio: 'inherit' })
}
})
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment