Skip to content
This repository has been archived by the owner on Jun 30, 2021. It is now read-only.

Commit

Permalink
Add return value for proccessProfiles
Browse files Browse the repository at this point in the history
Now proccessProfiles returns the data that is
also stored.
  • Loading branch information
schettn committed Nov 27, 2020
1 parent 420f05a commit cf3ff84
Showing 1 changed file with 29 additions and 25 deletions.
54 changes: 29 additions & 25 deletions src/utils/snek/person/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -237,33 +237,35 @@ const processProfiles = async (runnerOptions: { personName: string }) => {
mergedProfiles.statistic.current
);

const storingInfo = {
currentStatistic: JSON.stringify(
currentStatisticForVariableStore ? currentStatisticForVariableStore : {}
),
yearsStatistic: JSON.stringify(
mergedProfiles.statistic.years.map((e) =>
prepareStatisticForVariableStore(e)
)
),
languages: JSON.stringify(
mergedProfiles.statistic.languages
? mergedProfiles.statistic.languages
: ""
),
organisations: JSON.stringify(
mergedProfiles.profile?.organizations
? mergedProfiles.profile?.organizations
: ""
),
projects: JSON.stringify(
mergedProfiles.profile?.repositories
? mergedProfiles.profile?.repositories
: ""
),
};

writeVariableStore({
personName: runnerOptions.personName,
toStore: {
currentStatistic: JSON.stringify(
currentStatisticForVariableStore ? currentStatisticForVariableStore : {}
),
yearsStatistic: JSON.stringify(
mergedProfiles.statistic.years.map((e) =>
prepareStatisticForVariableStore(e)
)
),
languages: JSON.stringify(
mergedProfiles.statistic.languages
? mergedProfiles.statistic.languages
: ""
),
organisations: JSON.stringify(
mergedProfiles.profile?.organizations
? mergedProfiles.profile?.organizations
: ""
),
projects: JSON.stringify(
mergedProfiles.profile?.repositories
? mergedProfiles.profile?.repositories
: ""
),
},
toStore: storingInfo,
}).then((res) =>
res
? console.info(
Expand All @@ -273,6 +275,8 @@ const processProfiles = async (runnerOptions: { personName: string }) => {
`Couldn't successfully write variable store for Person: ${runnerOptions.personName}`
)
);

return storingInfo;
};

/**
Expand Down

0 comments on commit cf3ff84

Please sign in to comment.