Skip to content

Commit

Permalink
Merge pull request #123 from wzxjohn/master
Browse files Browse the repository at this point in the history
Create data directory to improve k8s convenience
  • Loading branch information
Revadike authored Sep 6, 2021
2 parents 111a32e + c9c9030 commit 32a7362
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ WORKDIR /app
COPY . /app
COPY --from=builder /app/node_modules ./node_modules
# Create empty history.json, disable loop in container
RUN echo "{}" > history.json \
&& sed -i 's/"loop": true/"loop": false/g' config.json
RUN echo "{}" > data/history.json \
&& sed -i 's/"loop": true/"loop": false/g' data/config.json

CMD ["npm", "start", "--no-update-notifier"]
8 changes: 4 additions & 4 deletions claimer.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ const { "Launcher": EpicGames } = require("epicgames-client");
const { freeGamesPromotions } = require("./src/gamePromotions");
const { writeFile } = require("fs");

const Auths = require(`${__dirname}/device_auths.json`);
const Auths = require(`${__dirname}/data/device_auths.json`);
const CheckUpdate = require("check-update-github");
const Config = require(`${__dirname}/config.json`);
const History = require(`${__dirname}/history.json`);
const Config = require(`${__dirname}/data/config.json`);
const History = require(`${__dirname}/data/history.json`);
const Logger = require("tracer").console(`${__dirname}/logger.js`);
const Package = require("./package.json");

Expand Down Expand Up @@ -104,7 +104,7 @@ function sleep(delay) {
Logger.info(`Logged ${client.account.name} out of Epic Games`);
}

await write(`${__dirname}/history.json`, JSON.stringify(History, null, 4));
await write(`${__dirname}/data/history.json`, JSON.stringify(History, null, 4));
if (loop) {
Logger.info(`Waiting ${delay} minutes`);
await sleep(delay);
Expand Down
File renamed without changes.
File renamed without changes.

0 comments on commit 32a7362

Please sign in to comment.