Skip to content

Commit

Permalink
Use 'type' instead of 'which' which is standard unix
Browse files Browse the repository at this point in the history
  • Loading branch information
KKoukiou authored and martinpitt committed May 11, 2023
1 parent e430ed1 commit 3a0391d
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/app.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ class AppActive extends React.Component {
if (this.props.error)
this.onAddErrorNotification({ text: _("Failed to fetch some resources"), detail: this.props.error });

cockpit.spawn(['which', 'virt-install'], { err: 'ignore' })
cockpit.script('type virt-install', { err: 'ignore' })
.then(() => {
this.setState({ virtInstallAvailable: true });
cockpit.spawn(['virt-install', '--install=?'], { err: 'ignore' })
Expand Down
2 changes: 1 addition & 1 deletion src/components/vm/overview/vmOverviewCard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class VmOverviewCard extends React.Component {
}

componentDidMount() {
cockpit.spawn(['which', 'virt-xml'], { err: 'ignore' })
cockpit.script('type virt-xml', { err: 'ignore' })
.then(() => {
this.setState({ virtXMLAvailable: true });
}, () => this.setState({ virtXMLAvailable: false }));
Expand Down
2 changes: 1 addition & 1 deletion src/components/vm/vmActions.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ const VmActions = ({ vm, onAddErrorNotification, isDetailsPage }) => {
const [virtCloneAvailable, setVirtCloneAvailable] = useState(false);

useEffect(() => {
cockpit.spawn(['which', 'virt-clone'], { err: 'ignore' })
cockpit.script('type virt-clone', { err: 'ignore' })
.then(() => setVirtCloneAvailable(true));
}, []);

Expand Down

0 comments on commit 3a0391d

Please sign in to comment.