Skip to content

Commit

Permalink
forgot to save the changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Charlie Pitkin committed Sep 22, 2017
1 parent ac2e2b0 commit f799bbc
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ function list(val) {
}

program
.version('0.3.0')
.version('0.3.1')
.option('-t, --token <string>', 'Slack API bot token. You should probably use ARCHIVEBOT_SLACK_TOKEN as an ENV VAR.')
.option('-d, --days [n]', 'Number of days of inactivity. Default: 30', parseInt)
.option('-m, --members [n]', 'Maximum number of members in the channel. Default: 1', parseInt)
Expand All @@ -59,7 +59,7 @@ function logChannels () {
}

function archiveChannel() {
const done
let done
if (!basic) {
done = elegantStatus(`Archiving channels -- ${archive.length}`);
}
Expand All @@ -73,7 +73,9 @@ function archiveChannel() {
}
clearInterval(timeout);
} else {
done.updateText(`Archiving channels -- ${archiveIndex+1}/${archive.length}`)
if (!basic) {
done.updateText(`Archiving channels -- ${archiveIndex+1}/${archive.length}`)
}
console.log(archive[archiveIndex].id);
let channel = archive[archiveIndex].id
slack.channels.archive({ token, channel }, (err) => {
Expand Down Expand Up @@ -105,7 +107,7 @@ function filterChannels() {
}

function getHistory(channels) {
const done
let done
if (!basic) {
done = elegantStatus(`Fetching channel history -- ${channels.length}`);
}
Expand All @@ -119,7 +121,9 @@ function getHistory(channels) {
filterChannels();
clearInterval(timeout)
} else {
done.updateText(`Fetching channel history -- ${channelIndex+1}/${channels.length}`)
if (!basic) {
done.updateText(`Fetching channel history -- ${channelIndex+1}/${channels.length}`)
}
let channel = channels[channelIndex].id
slack.channels.history({ token, channel, count }, (err, data) => {
if (err) {
Expand All @@ -141,9 +145,9 @@ function getHistory(channels) {
}

slack.channels.list({ token, exclude_archived, exclude_members }, (err, data) => {
const done
let done
if (!basic) {
done = elegantStatus('Fetching Slack channels');
done = elegantStatus('Fetching Slack channels')
}
if (err) {
if (!basic) {
Expand Down

0 comments on commit f799bbc

Please sign in to comment.