-
Notifications
You must be signed in to change notification settings - Fork 293
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Format documentation, migrate gulpfile.js to tasks.js (#4069)
* Moved kisshome-research@1.0.5 to stable * Update sources-dist-stable.json * Update sources-dist-stable.json --------- Co-authored-by: Martin M. <mcm57@gmx.at>
- Loading branch information
1 parent
93f7dc2
commit 5b5fac7
Showing
4 changed files
with
69 additions
and
77 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,67 +1,58 @@ | ||
const gulp = require('gulp'); | ||
const axios = require('axios'); | ||
|
||
// check if all adapters in stable have the version attribute | ||
// and published attribute | ||
gulp.task('init', done => { | ||
const scripts = require('./lib/scripts'); | ||
scripts.init().then(() => done()); | ||
}); | ||
|
||
gulp.task('stable', done => { | ||
const build = require('./lib/build'); | ||
const tools = require('./lib/tools'); | ||
tools.getRepositoryFile(`https://raw.githubusercontent.com/${tools.appName}/${tools.appName}.repositories/master/sources-dist-stable.json`, (err, data) => { | ||
if (err) { | ||
console.error(err); | ||
if (!data) process.exit(1); | ||
} | ||
build.getStats((err, stats) => { | ||
if (stats) { | ||
for (const adapter in stats) { | ||
if (stats.hasOwnProperty(adapter) && data[adapter]) { | ||
data[adapter].stat = stats[adapter]; | ||
} | ||
} | ||
} | ||
build.processRepository(data, ['--file', '/var/www/download/sources-dist-latest.json'], () => | ||
done()); | ||
}); | ||
}); | ||
}); | ||
|
||
gulp.task('latest', done => { | ||
const build = require('./lib/build'); | ||
const tools = require('./lib/tools'); | ||
axios(`https://raw.githubusercontent.com/${tools.appName}/${tools.appName}.repositories/master/sources-dist-stable.json`) | ||
.then(response => { | ||
const latest = response.data; | ||
tools.getRepositoryFile(`https://raw.githubusercontent.com/${tools.appName}/${tools.appName}.repositories/master/sources-dist.json`, latest, (err, data) => { | ||
if (err) { | ||
console.error(err); | ||
!data && process.exit(1); | ||
} | ||
build.getStats((err, stats) => { | ||
if (stats) { | ||
Object.keys(stats).forEach(adapter => { | ||
if (data[adapter]) { | ||
data[adapter].stat = stats[adapter]; | ||
} | ||
}); | ||
} | ||
build.processRepository(data, ['--file', '/var/www/download/sources-dist.json', '--shields', '/var/www/download/img'], () => | ||
done()); | ||
}); | ||
}); | ||
}); | ||
}); | ||
|
||
gulp.task('sort', done => { | ||
const scripts = require('./lib/scripts'); | ||
scripts.sort().then(done); | ||
}); | ||
|
||
gulp.task('nodates', done => { | ||
const scripts = require('./lib/scripts'); | ||
scripts.nodates().then(done); | ||
}); | ||
const axios = require('axios'); | ||
|
||
// check if all adapters in stable have the version attribute | ||
// and published attribute | ||
if (process.argv.includes('--init')) { | ||
const scripts = require('./lib/scripts'); | ||
scripts.init().catch(e => console.error(e)); | ||
} else if (process.argv.includes('--stable')) { | ||
const build = require('./lib/build'); | ||
const tools = require('./lib/tools'); | ||
tools.getRepositoryFile(`https://raw.githubusercontent.com/${tools.appName}/${tools.appName}.repositories/master/sources-dist-stable.json`, (err, data) => { | ||
if (err) { | ||
console.error(err); | ||
if (!data) { | ||
process.exit(1); | ||
} | ||
} | ||
build.getStats((err, stats) => { | ||
if (stats) { | ||
for (const adapter in stats) { | ||
if (stats.hasOwnProperty(adapter) && data[adapter]) { | ||
data[adapter].stat = stats[adapter]; | ||
} | ||
} | ||
} | ||
build.processRepository(data, ['--file', '/var/www/download/sources-dist-latest.json'], () => {}); | ||
}); | ||
}); | ||
} else if (process.argv.includes('--latest')) { | ||
const build = require('./lib/build'); | ||
const tools = require('./lib/tools'); | ||
axios(`https://raw.githubusercontent.com/${tools.appName}/${tools.appName}.repositories/master/sources-dist-stable.json`) | ||
.then(response => { | ||
const latest = response.data; | ||
tools.getRepositoryFile(`https://raw.githubusercontent.com/${tools.appName}/${tools.appName}.repositories/master/sources-dist.json`, latest, (err, data) => { | ||
if (err) { | ||
console.error(err); | ||
!data && process.exit(1); | ||
} | ||
build.getStats((err, stats) => { | ||
if (stats) { | ||
Object.keys(stats).forEach(adapter => { | ||
if (data[adapter]) { | ||
data[adapter].stat = stats[adapter]; | ||
} | ||
}); | ||
} | ||
build.processRepository(data, ['--file', '/var/www/download/sources-dist.json', '--shields', '/var/www/download/img'], () => {}); | ||
}); | ||
}); | ||
}); | ||
} else if (process.argv.includes('--sort')) { | ||
const scripts = require('./lib/scripts'); | ||
scripts.sort().catch(e => console.error(e)); | ||
} else if (process.argv.includes('--nodates')) { | ||
const scripts = require('./lib/scripts'); | ||
scripts.nodates().catch(e => console.error(e)); | ||
} |