Skip to content

Commit

Permalink
fix: bug when downloading files using OnePasswordPlugin
Browse files Browse the repository at this point in the history
  • Loading branch information
vanlooverenkoen committed Dec 11, 2023
1 parent 327b890 commit 2a0554d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# 0.9.1

# Fix:
- Bug when downloading files using `OnePasswordPlugin`

# 0.9.0

# Feat:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ import 'dart:io';
import 'package:impaktfull_cli/src/core/model/data/secret.dart';
import 'package:impaktfull_cli/src/core/plugin/impaktfull_cli_plugin.dart';
import 'package:impaktfull_cli/src/core/util/args/env/impaktfull_cli_environment_variables.dart';
import 'package:impaktfull_cli/src/core/util/logger/logger.dart';
import 'package:impaktfull_cli/src/integrations/testflight/model/testflight_credentials.dart';

class OnePasswordPlugin extends ImpaktfullCliPlugin {
String get serviceAccountEnvKey =>
ImpaktfullCliEnvironmentVariables.envKeyOnePasswordAccountToken;
String get serviceAccountEnvKey => ImpaktfullCliEnvironmentVariables.envKeyOnePasswordAccountToken;

const OnePasswordPlugin({
required super.processRunner,
Expand All @@ -33,14 +33,18 @@ class OnePasswordPlugin extends ImpaktfullCliPlugin {
Secret? rawServiceAccount,
}) async {
final exportFile = File(outputPath);
if (exportFile.existsSync()) {
ImpaktfullCliLogger.verbose('Deleting existing file: $outputPath');
exportFile.deleteSync();
}
await _executeOnePasswordCommand(
[
'op',
'document',
'get',
'"$opUuid"',
opUuid,
'--out-file',
'"${exportFile.path}"',
exportFile.path,
if (vaultName != null) ...[
'--vault',
vaultName,
Expand Down

0 comments on commit 2a0554d

Please sign in to comment.