Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added update object feature in Clocal-gcp #59

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,5 @@ typings/
# dotenv environment variables file
.env

# Mac Junk
.DS_Store
19 changes: 18 additions & 1 deletion src/services/cli-commands/cloud-storage/cmd.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ const action = (cmd, first, second) => {
case 'create':
create(first);
break;
case 'update':
updateObject();
break;
case 'delete':
deleteBucket(first);
break;
Expand All @@ -33,7 +36,6 @@ const action = (cmd, first, second) => {
case 'ls':
listObjects(first);
break;

default:
console.log(`command invalid ${cmd} ${first} ${second}`);
}
Expand Down Expand Up @@ -95,6 +97,21 @@ const listObjects = (bucketName) => {
}
};

const updateObject = (bucketName) => {
try {
exec(
`docker exec ${dockerId} bash scripts/update.sh ${bucketName}`,
(err, stdout, stderr) => {
if (err) console.log(chalk.bgRed(`failed to execute\n${stderr}`));
console.log(`${stdout}`);
}
);
throw Error('incomplete implementation');
} catch (err) {
return false;
}
};

const deleteObject = (bucketName, fileName) => {
try {
const config = new Configstore(path.join(pkg.name, '.containerList'));
Expand Down