Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Merged
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
21 changes: 10 additions & 11 deletions ci/bin/format.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
//
// Run with --help for usage.

import 'dart:ffi';
import 'dart:io';

import 'package:args/args.dart';
Expand Down Expand Up @@ -312,17 +313,15 @@ class ClangFormatChecker extends FormatChecker {
super.allFiles,
super.messageCallback,
}) {
/*late*/ String clangOs;
if (Platform.isLinux) {
clangOs = 'linux-x64';
} else if (Platform.isMacOS) {
clangOs = 'mac-x64';
} else if (Platform.isWindows) {
clangOs = 'windows-x64';
} else {
throw FormattingException(
"Unknown operating system: don't know how to run clang-format here.");
}
final clangOs = switch (Abi.current()) {
Abi.linuxArm64 => 'linux-arm64',
Abi.linuxX64 => 'linux-x64',
Abi.macosArm64 => 'mac-arm64',
Abi.macosX64 => 'mac-x64',
Abi.windowsX64 => 'windows-x64',
(_) => throw FormattingException(
"Unknown operating system: don't know how to run clang-format here.")
};
clangFormat = File(
path.join(
srcDir.absolute.path,
Expand Down
2 changes: 1 addition & 1 deletion ci/format.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
#
# Copyright 2013 The Flutter Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
Expand Down