forked from devonfw/IDEasy
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
devonfw#13: implement aws toolcommandlet
- Loading branch information
1 parent
fd02c60
commit 4d07265
Showing
4 changed files
with
47 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
package com.devonfw.tools.ide.tool.aws; | ||
|
||
import java.nio.file.Path; | ||
import java.util.Set; | ||
|
||
import com.devonfw.tools.ide.context.IdeContext; | ||
import com.devonfw.tools.ide.environment.EnvironmentVariables; | ||
import com.devonfw.tools.ide.environment.EnvironmentVariablesType; | ||
import com.devonfw.tools.ide.tool.ToolCommandlet; | ||
|
||
/** | ||
* {@link ToolCommandlet} for AWS CLI (aws). | ||
*/ | ||
|
||
public class Aws extends ToolCommandlet { | ||
|
||
/** | ||
* The constructor. | ||
* | ||
* @param context the {@link IdeContext}. | ||
*/ | ||
public Aws(IdeContext context) { | ||
|
||
super(context, "aws", Set.of(TAG_CLOUD)); | ||
} | ||
|
||
@Override | ||
public void postInstall() { | ||
|
||
super.postInstall(); | ||
|
||
EnvironmentVariables variables = this.context.getVariables(); | ||
EnvironmentVariables typeVariables = variables.getByType(EnvironmentVariablesType.CONF); | ||
|
||
Path awsConfigDir = this.context.getConfPath().resolve("aws"); | ||
this.context.getFileAccess().mkdirs(awsConfigDir); | ||
Path awsConfigFile = awsConfigDir.resolve("config"); | ||
Path awsCredentialsFile = awsConfigDir.resolve("credentials"); | ||
typeVariables.set("AWS_CONFIG_FILE", awsConfigFile.toString(), true); | ||
typeVariables.set("AWS_SHARED_CREDENTIALS_FILE", awsCredentialsFile.toString(), true); | ||
typeVariables.save(); | ||
} | ||
} |
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