Skip to content

Commit

Permalink
git desktop: Fix permissions on the key
Browse files Browse the repository at this point in the history
  • Loading branch information
vHanda committed Jul 23, 2021
1 parent 9597f35 commit 44666ea
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion lib/utils/git_desktop.dart
Expand Up @@ -3,8 +3,11 @@
import 'dart:convert';
import 'dart:io';

import 'package:dart_git/utils/file_extensions.dart';
import 'package:dart_git/utils/result.dart';

import 'package:gitjournal/utils/logger.dart';

Future<Result<void>> gitFetchViaExecutable({
required String repoPath,
required String privateKey,
Expand Down Expand Up @@ -48,8 +51,10 @@ Future<Result<void>> _gitCommandViaExecutable({

var dir = Directory.systemTemp.createTempSync();
var temp = File("${dir.path}/key");
temp.writeAsString(privateKey);
await temp.writeAsString(privateKey);
await temp.chmod(int.parse('0600', radix: 8));

Log.i("Running git $command $remoteName");
var process = await Process.start(
'git',
[
Expand Down
2 changes: 1 addition & 1 deletion pubspec.lock
Expand Up @@ -244,7 +244,7 @@ packages:
description:
path: "."
ref: HEAD
resolved-ref: "85eb017910093d10610159f984ffcfdc42bf4e83"
resolved-ref: bbda1eea8e3ea4b3097de4beb6f8aa65cfe98f6b
url: "https://github.com/GitJournal/dart-git.git"
source: git
version: "0.0.2"
Expand Down

0 comments on commit 44666ea

Please sign in to comment.